string to array
hi there i want o split this string into 2 arrays
one array has only ids
and others will have new|edit|del|view|password
thanks in advance
Use explode() on the pipe character to create array2, then use array_shift to pull the first element out of that array, which you can then parse with preg_match() to get the comma-delimited section within the square brackets, which you then explode() on the commas to populate array1.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)