Insert A Comma Seperated String Into An Array – explode()
If you need to insert a comma seperated string into a variable you can accomplish this with the following code. Let’s take a look at our string. $myString = “3,8,18,22”; We can insert our string into an array by simply using the explode() function. $newString = explode(‘,’, $myString); Now if we use the print_r() function…