Forum Moderators: coopster

Message Too Old, No Replies

$_ENV Picks up everything, how to divide it?

dividing parameter using a marker

         

kenchix1

8:37 am on Jun 6, 2005 (gmt 0)

10+ Year Member



I noticed that the $_ENV['QUERY_STRING'] picks up everything after the "?" of the php module. I have a module with several fixed number of parameters. What I wanted to do is pass a single parameter such as "12345A67890A123" then I'll cut the parameter using "A" as the marker for the first, second and third parameter. Is that possible? if yes, how do I divide the string?

Thanks! :)

mm1220

8:49 am on Jun 6, 2005 (gmt 0)

10+ Year Member



Well you would probably be better off seperating the variables with a '*'.

Anyway you could use:
$result = explode("A", $_ENV['QUERY_STRING']);

and you could access the variables:

$result[0], $result[1], etc.

grandpa

9:10 am on Jun 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Another option would be to substring your results.

$result = substr($_ENV['QUERY_STRING'],5,5);

will give you "A6789". ..I think..