<?php $s = '"Red", "Blue", "Orange", "Green"'; $s = str_replace(array('"', ', '), array("", ","), $s); // Remove the spaces and double quotes $a = explode(",", $s); var_dump($a);
Standard input is empty
array(4) { [0]=> string(3) "Red" [1]=> string(4) "Blue" [2]=> string(6) "Orange" [3]=> string(5) "Green" }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!