Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Note: I've tried searching for this in the PHP docs, but I can't figure
out how to make it search for the dollar sign; it simply ignores it.

I remember seeing the variable $_ used in some applications.  Is this a
variable that is "special" in PHP, or do people actually define this
cryptic thing?

Also, how can this be of use to me?

And one last thing:  How do I search (on Google or any other search
engine for that matter) with special characters.  If I put in "$_ +PHP"
in Google, it gives very odd results, which leads me to believe that it
ignores special characters such as $ and &.


Re: $_

Quoted text here. Click to load it

 It's not special in PHP. It is in Perl, where $_ is the default input and
pattern-searching space.

Quoted text here. Click to load it

 There's nothing special about it in PHP so it's just a cryptic variable name.

<http://www.andyhsoftware.co.uk/space Space: disk usage analysis tool

Re: $_

Some special variables, like $_POST, $_GET, $_REQUEST, $_SESSION,
$_SERVER, $_GLOBAL start with $_. These variable arrays are defined and
populated by PHP itself ... otherwise the $_ is not significant in any
way. All variables start with a dollarsign as you probably know though,
so to seach for a string with a $, you have to be careful. You have one
of two options - use single quotes ('  ') to define the strings you are
searching for - that way it won't process them further to try to expand
them with variable values, or to escape the dollarsign, I think with $
so instead of searching for $, you will be searching for $ ... I hope
that makes sense

Site Timeline