I\'m very new to php and I\'ve been spending quite some type understanding how to pass arguments from Python to php and conversely. I now know how to pass single variables,
$str = "[u'element1', u'element2', 'element3']"; $str = str_replace( array("u'", "[", "]"), array("'", ""), $str ); $strToPHPArray = str_getcsv($str, ",", "'"); print_r( $strToPHPArray );
Outputs
Array ( [0] => element1 [1] => element2 [2] => element3 )