Try explode:
$myString = "9,[email protected],8";
$myArray = explode(',', $myString);
print_r($myArray);
Output :
Array
(
[0] => 9
[1] => [email protected]
[2] => 8
)
More Related Contents:
- Convert backslash-delimited string into an associative array
- Convert a comma-delimited string into array of integers?
- php implode (101) with quotes
- PHP: Split string into array, like explode with no delimiter
- Explode string into array with no empty elements?
- Array Comparision with a string PHP
- Remove empty array elements
- Parse query string into an array
- Array to String PHP?
- How create an array from the output of an array printed with print_r?
- How to create an array from a CSV file using PHP and the fgetcsv function
- Convert array into csv
- Convert flat array to a delimited string to be saved in the database
- String with array structure to Array [duplicate]
- Unexpected bracket ‘[‘ – PHP [duplicate]
- use strings to access (potentially large) multidimensional arrays
- PHP: How can I explode a string by commas, but not wheres the commas are within quotes?
- How to split a long string without breaking words?
- String contains any items in an array (case insensitive)
- Convert a String into an Array of Characters
- How to cast array elements to strings in PHP?
- Search and replace multiple values with multiple/different values in PHP5?
- Create a comma-separated string from a single column of an array of objects
- Add a prefix to each item of a PHP array
- PHP get values from SimpleXMLElement array
- How to implode array with key and value without foreach in PHP
- How to convert array values to lowercase in PHP?
- Convert a String to Variable
- Check if string contains word in array [duplicate]
- Is there an equivalent in C++ of PHP’s explode() function? [duplicate]