php - Explode datalist into array -
I've found a list of data in the following format:
data \ ndata \ N data \ n data \ n data \ n
now I
$ array = explosion ("\ N", $ data list);
What happens next is that there is no key with any data, I think it's finally \ n.
Is there any way to explode it so that the last key was not set?
Thank you!
After you explode, use the last item to pop:
< Pre> $ array = explode ("\ n", $ dataList); Array_pop ($ array);
If you can add by using a statement and if you want to see that there is something other than a lineback character in the last thing, but you should do what you need.
Comments
Post a Comment