How would I write an IF statement that looks for the first space space (“ “)
left of the 76th character in a string or br, which ever comes first --- OR
the end of the string (IE the string is less than 76 characters long? I
specifically want is it’s character position in the string. Ron
The
What about something like this:
$pos = (strpos(' ', $string, 76))?strpos(' ',$string, 76):strlen($string);
Thanks,
Ash
http://www.ashleysheridan.co.uk
- Reply message -
From: Ron Piggott ron.pigg...@actsministries.org
Date: Sun, Nov 14, 2010 20:48
Subject: [PHP] Re: String manipulation
On 11/14/10 2:48 PM, Ron Piggott wrote:
How would I write an IF statement that looks for the first space space (“ “) left of
the 76th character in a string orbr, which ever comes first --- OR the end of
the string (IE the string is less than 76 characters long? I specifically want is
it’s
: Re: [PHP] Re: String manipulation
What about something like this:
$pos = (strpos(' ', $string, 76))?strpos(' ',$string, 76):strlen($string);
Thanks,
Ash
http://www.ashleysheridan.co.uk
- Reply message -
From: Ron Piggott ron.pigg...@actsministries.org
Date: Sun, Nov 14, 2010 20:48
On Nov 14, 2010, at 4:48 PM, Ron Piggott wrote:
Warning: strpos() [function.strpos]: Offset not contained in string
Shouldn't you check the length of the string before giving it the
offset?
From: a...@ashleysheridan.co.uk
$pos = (strpos(' ', $string, 76))?strpos(' ',$string,
Francisco Vaucher [EMAIL PROTECTED] wrote in message
news:3B966ABC166BAF47ACBF4639003B11AC848AE7;exchange.adtarg.com...
Hi to all (again ;-)
I need one or more PHP functions to handle a form input.
i.e. you write: [EMAIL PROTECTED]
I have to check that after the '@' comes 'test.com'. I
6 matches
Mail list logo