Re: A little confusing thing on (mistakenly) geting a offset from string with multi dim index.

From: Date: Thu, 15 May 2014 15:46:51 +0000
Subject: Re: A little confusing thing on (mistakenly) geting a offset from string with multi dim index.
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-323329@lists.php.net to get a copy of this message
On 05/14/2014 05:55 PM, Rain Lee wrote:
So, here is the TLDR; $string = 'this is a string'; In PHP 5.5 isset($string['check']) === false isset($string['check'][0]) === true Why can't let isset($string['check']) === false isset($string['check'][0]) === false <-- ?
I can see WHAT you are doing and WHAT the results are, but I don't understand WHY would you ever do this? You defined $string with a string of characters. But you are trying to use $string as an array. This hits me as completely wrong. I wanted to see an example of you doing this in a complete script. Because I cannot envision why you would ever end up doing this. And I wanted to see how you got to this as a solution. -- Jim Lucas http://www.cmsws.com/ http://www.cmsws.com/examples/

« previous php.general (#323329) next »