PHP $_GET['string'+$var] - Is this possible? -
php code far.
echo $sender = isset($_get['s']) ? $_get['s'] : "null"; echo $receiver = isset($_get['r']) ? $_get['r'] : "null"; echo $timestamp = isset($_get['t']) ? $_get['t'] : "0"; echo "<br/>"; echo $stotalitems = isset($_get['si']) ? intval($_get['si']) : 0; echo $rtotalitems = isset($_get['ri']) ? intval($_get['ri']) : 0; echo "<br/>"; ($i = 0; $i < $stotalitems; $i++) { echo $input = isset($_get['si'+$i]) ? urldecode($_get['si'+$i]) : "null"; if ($input == "null") continue; $input = explode(":", $input); var_dump($input); }
what i'm trying dynamically grab variable. i'm sending multiple requests, , contain same data, small differences. - question simple though. doesn't work i'm thinkin should in mind.
$_get['si'+$i];
in mind, should turn into..
$_get['si1'];
can done? or going have figure out way this? doing.. i'm sending multiple requests.. in following order basically..
http://dummy.com/integrate.php?s=me&r=you&t=3425&si=1&ri=2&si0=item:1:2&ri0=item:2:1&ri1=item:3:4
i'm trying make dynamically possible, send more 1 "item," in there identifier telling system, how many items there each sender, , receiver. loop goes through each sender & receivers' items, , separates item, 3 values. name, id, , amount. problem, code, isn't grabbing item @ all. correct, assume, can't use $_get method, , variable together?
yes can use dynamic variables along $_get
, problem use .
(period) concatenation not +
.
Comments
Post a Comment