Working with arrays.
| From: | Richard Quadling | Date: | Fri, 31 Dec 2010 13:48:59 +0000 |
| Subject: | Working with arrays. | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-51152@lists.php.net to get a copy of this message | ||
Hi.
What macros exist regarding processing arrays in PHP (core not userland)?
I want to pass ...
array('value1', 'value2', 'value3')
to a function and in the function have it converted to
'value1\0value2\0value3\0\0'.
Conventionally, I'd need to iterate the array to get the lengths of
all the elements, add the number of elements to this value and then 1
more for the trailing \0.
Unless there are some macros to allow to do this sort of thing more easily.
Regards,
Richard Quadling.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY