This is a discussion on Half solved (was foreach in search) within the PHP General forums, part of the PHP Programming Forums category; Hi, I am getting a lits of GET values and dumping the variable and the value into an array like ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
I am getting a lits of GET values and dumping the variable and the value into an array like so: $xxx=0; foreach ($_GET as $a => $v) { print "Current value of \$a:$a and \$v $v.\n <br>"; $test=$a."=".$v; $test1[$xxx]="".$test; $xxx++; } So now $test1[] contains the whole GET's variables and values, how do i pharse it so that i can dump all the $test[]s data like so: $someVar=$test[0]. "&" .$test[1]. "&" .$test[2].....etc Kindly help. Thanks, -Ryan We will slaughter you all! - The Iraqi (Dis)information ministers site http://MrSahaf.com |
|
|||
|
implode.....why the #@%# didnt i think of that??
Thanks dude. Just one last question, the last variable i am getting is page=1, how do i increase this? Basically I need to do a $page++ Thanks, -Ryan We will slaughter you all! - The Iraqi (Dis)information ministers site http://MrSahaf.com ----- Original Message ----- From: "skate" <root@fatcuban.com> To: "Ryan A" <ryan@jumac.com>; <php-general@lists.php.net> Sent: Sunday, August 10, 2003 9:23 PM Subject: Re: [php] Half solved (was foreach in search) > > > > > $someVar=$test[0]. "&" .$test[1]. "&" .$test[2].....etc > > > > $someVar = implode( "&", $test ); > > ... should do the trick > > |
|
|||
|
> implode.....why the #@%# didnt i think of that?? > Thanks dude. > Just one last question, the last variable i am getting is page=1, how do i > increase this? > Basically I need to do a $page++ > so do it then.... $xxx=0; foreach ($_GET as $a => $v) { print "Current value of \$a:$a and \$v $v.\n <br>"; if( $a = "page" ) $v++; $test=$a."=".$v; $test1[$xxx]="".$test; $xxx++; } does that look right? i think that's what your after anyway... |
|
|||
|
> > if ($action!='a1' || $action!='a3') //tried == also > { > //do stuff > } > else > { > //do other stuff > } > the logic behind this particular one doesn't work... if it's either not one, or not the other... it'll always be true... unless both are set to exactly the same... the logic if($action=="a1" || $action == "a3" ) should work find tho, coz it's checking to see if either is true... check what $action is actually set to by doing a print just before your if statement, and then stick two print's inside the if... true and false, in the respective place... hope this helps... |