Re: [suspicious - maybe spam] [PHP] [suspicious - maybe spam] detecting a leading hyphen from post data

From: Date: Mon, 21 Mar 2005 07:47:19 +0000
Subject: Re: [suspicious - maybe spam] [PHP] [suspicious - maybe spam] detecting a leading hyphen from post data
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-211169@lists.php.net to get a copy of this message
Larry Brown wrote:
I know this is pretty petty, but it is a sunday and I'm missing this for some reason... I'm trying to detect a leading hyphen in an element of an array. I've been using strpos to find strings and if getting 1 as the result, I know it was at the beginning of the string. However, "-", "\-", nor "/^-/" give me a hit? Could someone throw me a bone here?
if ($string{0} === "-") { echo "Woof"; }

« previous php.general (#211169) next »