Re: Strange string stuff -- maybe everything is ending...
| From: | Tedd Sperling | Date: | Sat, 22 Dec 2012 16:50:10 +0000 |
| Subject: | Re: Strange string stuff -- maybe everything is ending... | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-319941@lists.php.net to get a copy of this message | ||
On Dec 21, 2012, at 5:27 PM, Jim Giner <jim.giner@albanyhandball.com> wrote:
> From what I do know, there shouldn't be an a[4].
> In any case, let's assume that there is a bug in the string logic that you're using.
> Why not just use substr?
>
> $topic = substr($topic,0,-1);
and
On Dec 21, 2012, at 6:10 PM, Nathan Nobbe <quickshiftin@gmail.com> wrote:
> Neat idea Tedd, but judging by a quick test, I don't think changing the
> value of the string is entirely supported though that notation.
>
> php > $str = 'blah';
> php > $str[3] = '';
> php > echo $str . PHP_EOL;
> bla
> php > echo strlen($str);
> 4
I'm not looking for a solution, but rather pointing out something I never encountered before.
I would have never thought that a string echoed by a PHP script to be used in a JavaScript routine
would depend upon what Browser it is run on. That seems odd.
Cheers,
tedd
_____________________
tedd@sperling.com
http://sperling.com