Page 1 of 1
help me with code
Posted: Mon May 26, 2008 1:29 am
by avera
Can someone tell me what these things do
Code: Select all
$a = $_POST['b'];
if ($a[0] == 'a' || $a[0] == 'A,') {
echo 'ohhoo';
} else {
echo 'ehhee';
}
//
Code: Select all
$a = $_POST['b'];
$c = explode (' ',$a);
shuffle($c);
echo implode(' ',$c)
;
Re: help me with code
Posted: Mon May 26, 2008 1:55 am
by hansford
$a = $_POST['b']; //takes form value named 'b' and puts in var $a
if ($a[0] == 'a' || $a[0] == 'A,') { //checks if first char is an 'a' or 'A'
echo 'ohhoo'; //if it is then display this 'ohhoo'
} else {
echo 'ehhee'; //if not then display this 'ehhee'
}
$a = $_POST['b'];
$c = explode (' ',$a); //split the 'string' at each blank space and store values in array named $c
shuffle($c); //mix up the array
echo implode(' ',$c) put the array back together into a string
----------------------------------------
search in google for each function ie shuffle(), implode() etc
Re: help me with code
Posted: Mon May 26, 2008 2:26 am
by avera
thanks:D