Created
October 29, 2015 16:57
-
-
Save d30jeff/441af97972919076e5a1 to your computer and use it in GitHub Desktop.
Bullshit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $string = "A,B,C,D,'1,2,3,4,5,6',F,G"; | |
| $boom = explode("'", $string)[1]; | |
| $new_string = str_replace($boom, "", $string); | |
| foreach (explode(",", $new_string) as $letter) { | |
| if ($letter != "''") { | |
| $array[] = $letter; | |
| } else { | |
| $array[] = $boom; | |
| } | |
| } | |
| echo '<pre>'.print_r($array, true).'</pre>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment