I’ve done some searching around and most posts are using the php explode function to separate a string and store its values into an array.
I need an efficient way to convert:
$string = "45,34,65,57,45,23,26,72,73,56";
To an array, so I can access single values using $array[3].
Is there a better method than explode?
This is probably the most efficient if you need to handle really long, and I mean really long, strings. For anything of the size you have posted as example, use
explode.If your parts are all the same length, just do: