Help Me Extract a Value :)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
robindean
Forum Newbie
Posts: 7
Joined: Mon May 11, 2009 3:47 pm

Help Me Extract a Value :)

Post 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?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Help Me Extract a Value :)

Post 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.
Post Reply