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,
76):str
php.net
Subject: 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"
Date: Sun, Nov 14,
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 or, 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 charac
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"
Date: Sun, Nov 14, 2010 20:48
Subject: [PHP] Re: String manipulation
To:
How would I write an I
4 matches
Mail list logo