Re: Use array returned by function directly?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ivailo91@xxxxxxxxx wrote:
What's the best way to achieve something like this:
explode($needle, $array)[3]
It's too clumsy to use temporary array, and I suppose, quite slow. Is there any option, or I'll have to stick to temporary arrays?

Best Regards,
Ivailo Karamanolev


I think you are meaning this:
<?php

$str = "zero@xxxxxxxxxxxxx,one@xxxxxxxxxxxxx,two@xxxxxxxxxxxxx";

echo explode(',', $str)[1];

?>

If it worked, this would return "one@xxxxxxxxxxxxx"

I remember this discussion 7 years ago.  This feature is not possible.

IMO it would be a very handy feature!

--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different strings. But there are times for you and me when all such things agree.

- Rush

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux