Page 1 of 1

Help Me Extract a Value :)

Posted: Mon May 11, 2009 4:03 pm
by robindean
Ampersands are causing chaos for my pages.

If I don't use "&" in a url, my pages won't validate. If I do, php appends only the "amp;" part to each of my variables.

So, I've devised a solution which is yet to be complete (I need help).

Basically, I'm starting off with ...

$query = str_replace('&', '&', $_SERVER['QUERY_STRING']);

This grabs the entire query and replaces "&" with simply "&".

I need a way to locate specific variable values within this, using a method similar to $_GET.

Is there a $_GET method for strings? If not and a function is necessary, please guide me through it.

The function call should work in a manner such as ...

$myVariable = GetVarValue('Variable_Name');

How?

Re: Help Me Extract a Value :)

Posted: Mon May 11, 2009 7:19 pm
by califdon
I don't understand what you are trying to do. & is a HTML special character. I don't see what it is you are trying to do with it, surely not in PHP, where it has no special meaning.