Skip to content

Tag: explode

Explode a string to array with key => value

I have string is: How Can I convert from $string to an array with key => value. Updated: @Mark Baker my php version is 5.4 so I cannot test your code, thanks @Aleatoric I’m use this code, but the array return some space character on key and value: I have use trim() to strips all space, but can you te…

explode an array of delimited strings into two arrays

I have the following array: that I need to split into two arrays using “-” as delimiter: and Is there anything like array_explode that does what I want? or a combination of php array functions? I’d like to do this without going through my own for/each loop, if possible, or at least minimize …