Re: Array Question
| From: | Richard Lynch | Date: | Wed, 11 Jul 2007 21:11:35 +0000 |
| Subject: | Re: Array Question | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-258646@lists.php.net to get a copy of this message | ||
On Wed, July 11, 2007 9:52 am, Stut wrote:
>> $needle = (array)$needle;
>>
>> Conversion to array creates an array with one element... the value
>> converted.
>
> Without raising a notice?
Sure looks like it:
php -d error_reporting=2047 -r '$foo = (array) "foo"; var_dump($foo);'
array(1) {
[0]=>
string(3) "foo"
}
But I'd have to say that the intent is not all that clear, really, and
I'd be leery of this feature, personally.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?