|
cool ok got another question if i use this bit of code first of all is this teling it to turn the string $ints into this array interests my qUESTION IS WHAT DOES THE (',', THAT DO IN THIS BIT CODE
}$ints = implode (',', $_POST['interests']);
also this code here what does the <pre> tag do and also where is say echo "$key\t$value\n"; why is there a t before $value
<?php
# script 2.13 - sorting.php
//create the array.
$movies=array('10' =>'cosablanca',
'9.65' => 'to kill a mockingbird',
'2.35' => ' the english patient',
'8' => ' traffic');
//display the movies in their original order:
echo 'in there original order:
<br /><pre> Rating Title ';
foreach ($movies as $key => $value){
echo "$key\t$value\n";
}
echo '</pre>';
//display the movies sorted by title:
echo 'sorted by title:<br /><pre>Rating title:';
asort ($movies);
foreach ($movies as $key => $value){
echo "$key\t$value\n";
}
echo '</pre>';
//display the movies sorted by rating:
echo 'sorted by rating:<br /><pre>Rating title';
krsort($movies);
foreach ($movies as $key => $value){
echo "$key\t$value\n";
}
echo '</pre>';
?>
Last edited by millwalll; 06-16-2005 at 01:39 PM..
|