ichimac Posted May 6, 2009 Share Posted May 6, 2009 I using this function to generate a random number it work awesome however I will like know if there is a way to find out what was the previous number that function created. I will most grateful I could get some help whit this $min = 1; $max = 238; $disallowed = array(4,5,6,8,9,10,12,13,18,19,20,23); function mt_rand_n($min="1",$max,$disallowed) { if (!is_array($disallowed)) return false; $numbers = array_values(array_diff(range($min,$max),$disallowed)); if (count($numbers) < 1) return false; return $numbers[mt_rand(0,count($numbers) - 1)]; } $id_rand = mt_rand_n($min, $max, $disallowed); because what I'm trying to do is this: the function will created a random number i add that random number in a mysql string to call a user profile and then gives you the option to post a comment, but the way it is at the moment that comment goes to next random number generated not the current one, for example if I have user_id 8, but next number coming is 23 the comment goes to user 23 not 8. I hope it make sense Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/ Share on other sites More sharing options...
Ken2k7 Posted May 6, 2009 Share Posted May 6, 2009 What do you mean the previous number? Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827643 Share on other sites More sharing options...
premiso Posted May 6, 2009 Share Posted May 6, 2009 Store it in a text file with fopen and fwrite or store it in a DB entry. Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827652 Share on other sites More sharing options...
ichimac Posted May 6, 2009 Author Share Posted May 6, 2009 for example $ramdon_id = mt_rand(1,200) ; will pull like 4,8,9,29,89,23, etc....after that first number is generated (4) for example the next one up is 8 I will like to keep that previous generated number on a variable if possible $old_id = (what ever that number was) .... I hope it make sense Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827659 Share on other sites More sharing options...
Ken2k7 Posted May 6, 2009 Share Posted May 6, 2009 Store it in an array? Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827662 Share on other sites More sharing options...
ichimac Posted May 6, 2009 Author Share Posted May 6, 2009 I already try to store that number to a db for some reason it stores the new value not the old one.. Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827671 Share on other sites More sharing options...
Ken2k7 Posted May 6, 2009 Share Posted May 6, 2009 Show me the code. Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827673 Share on other sites More sharing options...
ichimac Posted May 6, 2009 Author Share Posted May 6, 2009 <?php require_once("includes/session.php"); include('includes/connection.inc.php'); include('includes/corefuncs.php'); $conn = dbConnect('query'); $min = 42; $max = 118; $disallowed = array(117); function mt_rand_n($min="1",$max,$disallowed) { if (!is_array($disallowed)) return false; $numbers = array_values(array_diff(range($min,$max),$disallowed)); if (count($numbers) < 1) return false; return $numbers[mt_rand(0,count($numbers) - 1)]; } $id_rand = mt_rand_n($min, $max, $disallowed); $sql = "SELECT feed_id,user_nickname,gender,image_normal,user_age,user_location,user_status FROM feed WHERE feed_id='$id_rand' "; $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($result); ?> <div id="dude"> <form id="rating" name="rating" method="post" > <input type="radio" name="rating" value="1" onClick="this.form.submit()" />Good <input type="radio" name="rating" value="2" onClick="this.form.submit()" />Really Good <input type="radio" name="rating" value="3" onClick="this.form.submit()" />Awesome </p> </form> <p><?php echo $row['user_nickname']; ?> / <?php echo $row['user_age'];?> / <?php echo $row['user_status'];?>/ <?php echo $row['user_location'];?></p> <img src="<?php echo $row['image_normal']; ?>" /> <p><?php echo $row['user_feed']; ?></p></td> <td width="83" align="left" valign="top" bgcolor="#FFFFFF"> feed_id : <?php echo $row['feed_id']; ?> <form id="comment" name="comment" method="post"> <label for="article" class="style2">Que cuentas</label> feed_id : <?php echo $row['feed_id']; ?> <p><textarea name="article" cols="35" rows="4" class="style3" id="article"></textarea></p> <p><input type="submit" name="comment" id="comment" value="comment" /> <input name="message_for" type="hidden" id="message_for" value="<?php echo $row['feed_id'];?>"/> </p> </form> <?php //************************************************************************** if (array_key_exists('comment', $_POST)) { // create database connection $conn = dbConnect('admin'); // remove backslashes nukeMagicQuotes(); // prepare an array of expected items $expected = array('carry_user_id','feed_id','article', 'message_for'); // make $_POST data safe for insertion into database foreach ($_POST as $key => $value) { if (in_array($key, $expected)) { ${$key} = mysql_real_escape_string($value); } } // initialize error array $comment_message = array(); // check length of usecomment if (empty($article)) { $comment_message[] = 'Please enter your comment'; } //if (!$comment_message) { if ($row['feed_id'] ) { echo $row['feed_id']; // prepare the SQL query $sql_comment = "INSERT INTO journal (carry_user_id, article, created, message_for) VALUES('$user_id', '$article', NOW(),'{$row['feed_id']}')"; // process the query $comment_result = mysql_query($sql_comment) or die(mysql_error()); } } //****************************************************************** ?> </td></tr><tr bgcolor="#CCCCCC"> <th align="left" valign="top" bgcolor="#FFFFFF" > </th> <td align="left" valign="bottom" bgcolor="#FFFFFF"> </td> </tr> </table> </div> <br class="clearfloat" /> <?php include('includes/footer.php'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827676 Share on other sites More sharing options...
Ken2k7 Posted May 6, 2009 Share Posted May 6, 2009 Please read Forum DOs #4 - http://www.phpfreaks.com/page/rules-and-terms-of-service#toc_forum_dos Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827679 Share on other sites More sharing options...
ichimac Posted May 6, 2009 Author Share Posted May 6, 2009 my bad let me do it again Im just sort new on learning this things Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827688 Share on other sites More sharing options...
ichimac Posted May 6, 2009 Author Share Posted May 6, 2009 Im sorry I started change colors by hand (ooh boy that was taking for ever) and thing time out I did a prt sc maybe this help better....thanks a lot i really meant that Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827747 Share on other sites More sharing options...
premiso Posted May 6, 2009 Share Posted May 6, 2009 You could just use the or tags around code to highlight it etc. That was what Kev was referring to. Example: // Place Code Here Or: // Place PHP Code Here Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827748 Share on other sites More sharing options...
ichimac Posted May 6, 2009 Author Share Posted May 6, 2009 ooh man I didn't you could do that ...thank you now I know how to color the code Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827764 Share on other sites More sharing options...
Ken2k7 Posted May 6, 2009 Share Posted May 6, 2009 Your effort on getting those images is most admirable. Most people would not go that far. I'm still at a lost. Anyone else here understand what ichimac wants to do? Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827769 Share on other sites More sharing options...
nrg_alpha Posted May 6, 2009 Share Posted May 6, 2009 Preferably ...code... as ...code... doesn't colour code things. <--- likes colours I think code tags are ok for a simple 1 liner example.. but going too much beyond that, I would go with php tags instead. EDIT - When possible, try to post only the relevant segment of problematic code instead of the entire mountain of it.. can quickly turn people off seeing how this represents them needing to spend extra time trying to decipher things. Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827774 Share on other sites More sharing options...
ichimac Posted May 6, 2009 Author Share Posted May 6, 2009 thank you thank you. what I'm trying to do is this: the function will created a random number i add that random number into a mysql string to call a user profile and then gives you the option to post a comment, but the way it is at the moment that comment goes to next random number generated not the current one, for example if I have user_id 8, but next number coming is 23 the comment goes to user 23 not 8. carry_user_id is the user thats sending the message and message for is where the message is going but is not going to the correct user Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827784 Share on other sites More sharing options...
ichimac Posted May 6, 2009 Author Share Posted May 6, 2009 thank you thank you the function will created a random number i add that random number in a mysql string to call a user profile and then gives you the option to post a comment, but the way it is at the moment that comment goes to next random number generated not the current one, for example if I have user_id 8, but next number coming is 23 the comment goes to user 23 not 8. carry_user_id is the person thats sending the message article is the message and message for is the user thats receiving it Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827786 Share on other sites More sharing options...
Ken2k7 Posted May 6, 2009 Share Posted May 6, 2009 Wow That is funny! Can you show me the part of the code the defines the variable $article? I'm thinking that is wrong instead of the message_for. Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827790 Share on other sites More sharing options...
ichimac Posted May 6, 2009 Author Share Posted May 6, 2009 sure is // prepare an array of expected items $expected = array('carry_user_id','feed_id','article', 'message_for'); because the other values are going to correct place is just message_for ps: holy cow i didn't have to color anything by hand lol Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827796 Share on other sites More sharing options...
Daniel0 Posted May 6, 2009 Share Posted May 6, 2009 Preferably ...code... as ...code... doesn't colour code things. <--- likes colours I think code tags are ok for a simple 1 liner example.. but going too much beyond that, I would go with php tags instead. does, but only within PHP tags. Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827797 Share on other sites More sharing options...
Ken2k7 Posted May 6, 2009 Share Posted May 6, 2009 Can you either post the entire code or PM it to me? Did you change any values between lines 27 - 176? Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827801 Share on other sites More sharing options...
ichimac Posted May 6, 2009 Author Share Posted May 6, 2009 those other lines are just html and css but i'll post it <?php require_once("includes/session.php"); include('includes/connection.inc.php'); include('includes/corefuncs.php'); $conn = dbConnect('query'); $min = 42; $max = 118; $disallowed = array(117); function mt_rand_n($min="1",$max,$disallowed) { if (!is_array($disallowed)) return false; $numbers = array_values(array_diff(range($min,$max),$disallowed)); if (count($numbers) < 1) return false; return $numbers[mt_rand(0,count($numbers) - 1)]; } $id_rand = mt_rand_n($min, $max, $disallowed); $sql = "SELECT feed_id,user_nickname,gender,image_normal,user_age,user_location,user_status FROM feed WHERE feed_id='$id_rand' "; $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($result); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>fresaOno | <?php echo $row['user_nickname']; ?>'s home page</title> <link href="css/style.css" rel="stylesheet" type="text/css" /> <!--[if IE 5]> <style type="text/css"> /* place css box model fixes for IE 5* in this conditional comment */ .thrColFixHdr #sidebar1 { width: 180px; } .thrColFixHdr #sidebar2 { width: 190px; } </style> <![endif]--><!--[if IE]> <style type="text/css"> /* place css fixes for all versions of IE in this conditional comment */ .thrColFixHdr #sidebar2, .thrColFixHdr #sidebar1 { padding-top: 30px; } .thrColFixHdr #mainContent { zoom: 1; } /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */ </style> <![endif]--> <style type="text/css"> <!-- .style2 { /* color: #FF00FF;*/ color: #DC143C; font-weight:bold; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 14px; background-color:transparent; } .style3 { color: #4169E1; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight:bold; font-size:12px; background-color:#ECF1EF; } div #dude { color:pink; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight:bold; font-size:16px; background-image:url(images/me4.png); background-repeat:no-repeat; width:480px; } .style6 { font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; } div #score { font-family: Geneva, Arial, Helvetica, sans-serif; font-weight:bold; font-size:30px; color:#FF3300; } div #links, #links1, #links2{ font-family: Geneva, Arial, Helvetica, sans-serif; font-size:14px; font-weight:bold; background-image:url(images/banner12.png); background-repeat:no-repeat; padding-bottom:1%; /* border-bottom:dotted;*/ } table, td, tr,th { background-color:transparent; } a{ text-decoration: none; } a:link { color: #0063DC; } a:visited { color: #0063DC; } a:active { color:red; } a:hover { background-color:#0063DC; color:white ; } .style1 {color: #FF0084} --> </style> </head> <body> <body class="thrColFixHdr"> <div id="container"> <div id="header"> <!-- end #header --> </div> <div id="sidebar1"> <form id="logoutForm" name="logoutForm" method="post" action=""> <input name="logout" type="submit" id="logout" value="Log out" /> </form> </div><!-- end #sidebar1 --> <div id="sidebar2"> </div> <div id="mainContent"> <!-- Start change by Edgar November 3 2008--> <?php // echo "my current session ID: $current_session"; // run this script only if the logout button has been clicked if (array_key_exists('logout', $_POST)) { // empty the $_SESSION array $_SESSION = array(); // invalidate the session cookie if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time()-86400, '/'); } // end session and redirect session_destroy(); header('Location: http://localhost/'); exit; } ?> <!--End change by Edgar October 13 2008--> <!-- end #mainContent --> <div id="dude"> <form id="rating" name="rating" method="post" > <!--<input type="hidden" name="image_id" value="$image_id" />--> <center>freseando </center> <p> <input type="radio" name="rating" value="1" onClick="this.form.submit()" />good <input type="radio" name="rating" value="2" onClick="this.form.submit()" />really good <input type="radio" name="rating" value="3" onClick="this.form.submit()" />awesome</p> </form> </div> <!--controls border at the end of the page --!> <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --> <div> <table width="412" > <tr bgcolor="#CCCCCC"> <td width="317" align="left" valign="top" bgcolor="#FFFFFF" > <p><?php echo $row['user_nickname']; ?> / <?php echo $row['user_age'];?> / <?php echo $row['user_status'];?>/ <?php echo $row['user_location'];?></p> <img src="<?php echo $row['image_normal']; ?>" /> <p><?php echo $row['user_feed']; ?></p></td> <td width="83" align="left" valign="top" bgcolor="#FFFFFF"> feed_id : <?php echo $row['feed_id']; ?> <form id="comment" name="comment" method="post"> <label for="article" class="style2">Que cuentas</label> feed_id : <?php echo $row['feed_id']; ?> <p><textarea name="article" cols="35" rows="4" class="style3" id="article"></textarea></p> <p><input type="submit" name="comment" id="comment" value="comment" /> <input name="message_for" type="hidden" id="message_for" value="<?php echo $row['feed_id'];?>"/> </p> </form> <?php //************************************************************************** if (array_key_exists('comment', $_POST)) { // create database connection $conn = dbConnect('admin'); // remove backslashes nukeMagicQuotes(); // prepare an array of expected items $expected = array('carry_user_id','feed_id','article', 'message_for'); // make $_POST data safe for insertion into database foreach ($_POST as $key => $value) { if (in_array($key, $expected)) { ${$key} = mysql_real_escape_string($value); } } // initialize error array $comment_message = array(); // check length of usecomment if (empty($article)) { $comment_message[] = 'Please enter your comment'; } //if (!$comment_message) { if ($row['feed_id'] ) { echo $row['feed_id']; // prepare the SQL query $sql_comment = "INSERT INTO journal (carry_user_id, article, created, message_for) VALUES('$user_id', '$article', NOW(),'{$row['feed_id']}')"; // process the query $comment_result = mysql_query($sql_comment) or die(mysql_error()); } } //****************************************************************** ?> </td></tr><tr bgcolor="#CCCCCC"> <th align="left" valign="top" bgcolor="#FFFFFF" > </th> <td align="left" valign="bottom" bgcolor="#FFFFFF"> </td> </tr> </table> </div> <br class="clearfloat" /> <?php include('includes/footer.php'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827817 Share on other sites More sharing options...
Ken2k7 Posted May 6, 2009 Share Posted May 6, 2009 Let me know what the var_dumps print out. <?php require_once("includes/session.php"); include('includes/connection.inc.php'); include('includes/corefuncs.php'); $conn = dbConnect('query'); $min = 42; $max = 118; $disallowed = array(117); function mt_rand_n($min="1",$max,$disallowed) { if (!is_array($disallowed)) return false; $numbers = array_values(array_diff(range($min,$max),$disallowed)); if (count($numbers) < 1) return false; return $numbers[mt_rand(0,count($numbers) - 1)]; } $id_rand = mt_rand_n($min, $max, $disallowed); var_dump($id_rand); $sql = "SELECT feed_id,user_nickname,gender,image_normal,user_age,user_location,user_status FROM feed WHERE feed_id='$id_rand' "; $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($result); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>fresaOno | <?php echo $row['user_nickname']; ?>'s home page</title> <link href="css/style.css" rel="stylesheet" type="text/css" /> <!--[if IE 5]> <style type="text/css"> /* place css box model fixes for IE 5* in this conditional comment */ .thrColFixHdr #sidebar1 { width: 180px; } .thrColFixHdr #sidebar2 { width: 190px; } </style> <![endif]--><!--[if IE]> <style type="text/css"> /* place css fixes for all versions of IE in this conditional comment */ .thrColFixHdr #sidebar2, .thrColFixHdr #sidebar1 { padding-top: 30px; } .thrColFixHdr #mainContent { zoom: 1; } /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */ </style> <![endif]--> <style type="text/css"> <!-- .style2 { /* color: #FF00FF;*/ color: #DC143C; font-weight:bold; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 14px; background-color:transparent; } .style3 { color: #4169E1; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight:bold; font-size:12px; background-color:#ECF1EF; } div #dude { color:pink; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight:bold; font-size:16px; background-image:url(images/me4.png); background-repeat:no-repeat; width:480px; } .style6 { font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: bold; } div #score { font-family: Geneva, Arial, Helvetica, sans-serif; font-weight:bold; font-size:30px; color:#FF3300; } div #links, #links1, #links2{ font-family: Geneva, Arial, Helvetica, sans-serif; font-size:14px; font-weight:bold; background-image:url(images/banner12.png); background-repeat:no-repeat; padding-bottom:1%; /* border-bottom:dotted;*/ } table, td, tr,th { background-color:transparent; } a{ text-decoration: none; } a:link { color: #0063DC; } a:visited { color: #0063DC; } a:active { color:red; } a:hover { background-color:#0063DC; color:white ; } .style1 {color: #FF0084} --> </style> </head> <body> <body class="thrColFixHdr"> <div id="container"> <div id="header"> <!-- end #header --> </div> <div id="sidebar1"> <form id="logoutForm" name="logoutForm" method="post" action=""> <input name="logout" type="submit" id="logout" value="Log out" /> </form> </div><!-- end #sidebar1 --> <div id="sidebar2"> </div> <div id="mainContent"> <!-- Start change by Edgar November 3 2008--> <?php // echo "my current session ID: $current_session"; // run this script only if the logout button has been clicked if (array_key_exists('logout', $_POST)) { // empty the $_SESSION array $_SESSION = array(); // invalidate the session cookie if (isset($_COOKIE[session_name()])) { setcookie(session_name(), '', time()-86400, '/'); } // end session and redirect session_destroy(); header('Location: http://localhost/'); exit; } ?> <!--End change by Edgar October 13 2008--> <!-- end #mainContent --> <div id="dude"> <form id="rating" name="rating" method="post" > <!--<input type="hidden" name="image_id" value="$image_id" />--> <center>freseando </center> <p> <input type="radio" name="rating" value="1" onClick="this.form.submit()" />good <input type="radio" name="rating" value="2" onClick="this.form.submit()" />really good <input type="radio" name="rating" value="3" onClick="this.form.submit()" />awesome</p> </form> </div> <!--controls border at the end of the page --!> <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --> <div> <table width="412" > <tr bgcolor="#CCCCCC"> <td width="317" align="left" valign="top" bgcolor="#FFFFFF" > <p><?php echo $row['user_nickname']; ?> / <?php echo $row['user_age'];?> / <?php echo $row['user_status'];?>/ <?php echo $row['user_location'];?></p> <img src="<?php echo $row['image_normal']; ?>" /> <p><?php echo $row['user_feed']; ?></p></td> <td width="83" align="left" valign="top" bgcolor="#FFFFFF"> feed_id : <?php echo $row['feed_id']; ?> <form id="comment" name="comment" method="post"> <label for="article" class="style2">Que cuentas</label> feed_id : <?php echo $row['feed_id']; ?> <p><textarea name="article" cols="35" rows="4" class="style3" id="article"></textarea></p> <p><input type="submit" name="comment" id="comment" value="comment" /> <input name="message_for" type="hidden" id="message_for" value="<?php echo $row['feed_id'];?>"/> </p> </form> <?php //************************************************************************** if (array_key_exists('comment', $_POST)) { // create database connection $conn = dbConnect('admin'); // remove backslashes nukeMagicQuotes(); // prepare an array of expected items $expected = array('carry_user_id','feed_id','article', 'message_for'); // make $_POST data safe for insertion into database foreach ($_POST as $key => $value) { if (in_array($key, $expected)) { ${$key} = mysql_real_escape_string($value); } } var_dump($article); // initialize error array $comment_message = array(); // check length of usecomment if (empty($article)) { $comment_message[] = 'Please enter your comment'; } //if (!$comment_message) { if ($feed_id] ) { // prepare the SQL query $sql_comment = "INSERT INTO journal (carry_user_id, article, created, message_for) VALUES('$user_id', '$article', NOW(),'$feed_id'')"; var_dump($sql_comment); // process the query $comment_result = mysql_query($sql_comment) or die(mysql_error()); } } //****************************************************************** ?> </td></tr><tr bgcolor="#CCCCCC"> <th align="left" valign="top" bgcolor="#FFFFFF" > </th> <td align="left" valign="bottom" bgcolor="#FFFFFF"> </td> </tr> </table> </div> <br class="clearfloat" /> <?php include('includes/footer.php'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827824 Share on other sites More sharing options...
nrg_alpha Posted May 6, 2009 Share Posted May 6, 2009 Preferably ...code... as ...code... doesn't colour code things. <--- likes colours I think code tags are ok for a simple 1 liner example.. but going too much beyond that, I would go with php tags instead. does, but only within PHP tags. Ah, thanks for the heads up that. Didn't think about nesting those tags together. I always figured it was always either one or the other. Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827925 Share on other sites More sharing options...
Daniel0 Posted May 6, 2009 Share Posted May 6, 2009 Oh, no that wasn't what I meant. Compare this: hello <?php echo 'hello'; ?> hello with: hello <?php echo 'hello'; ?> hello Quote Link to comment https://forums.phpfreaks.com/topic/157104-mt_rand/#findComment-827951 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.