Hi Ashim,
These are called Variable Variables. Ideally they should be avoided,
as they introduce unnecessary legibility issues.
This is what it does in a nutshell, it's actually quite simple:
$foo = 'bar';
$bar = 'foobar';
echo $$foo;//This prints foobar
What it does is, take the value of $
stripslashes() is rife with gaping security holes. For mysql
insertion rely on mysql_real_escape_string() or alternatively, you can
use prepared statements.
For outputting data on the page you should ideally be using
htmlspecialchars($var, ENT_QUOTES);
cheers,
Russ
On Thu, Dec 23, 2010 at 6:48
I would stay clear of the ternary operator in nested coditions, for
obvious reasons. If it can fit in a single line and is essentially
clear in its message I dont see why not to use it.
On Thu, Oct 21, 2010 at 8:39 PM, Gary wrote:
> Russell Dias wrote:
>
>> preg_match("/
arison.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
> - Reply message -----
> From: "Russell Dias"
> Date: Thu, Oct 21, 2010 11:03
> Subject: [PHP] "My truth comes out" [1]
> To: "a...@ashleysheridan.co.uk"
> Cc:
&g
using settype() on the string? I've not tested it, but it looks
> like it should do the trick.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
> - Reply message -
> From: "Russell Dias"
> Date: Thu, Oct 21, 2010 10:51
> Subject: [PHP
preg_match("/false/i", $string) ? false : true;
On Thu, Oct 21, 2010 at 7:39 PM, Gary wrote:
> Is there any nice way to convert a string containing either "TRUE" or
> "FALSE" to a bool with the appropriate value? I know I can just "if
> (strcmp..." but, as the song goes on to say "...ugly, so u
For me:
LAMP stack of course.
Javascript and jQuery
Python
Learning new languages open your mind to a whole new set of
possibilities. It also improves the way you code in your language of
choice. At this point in time, my goals are one language a year.
Eventually I would like to get to a point
I'm currently stuck on a little problem. I'm using cURL in conjunction
with DOMDocument and Xpath to scrape data from a couple of websites.
Please note that is only for personal and educational purposes.
Right now I have 5 independent scripts (that traverse through 5
websites) that run via a cron
8 matches
Mail list logo