[code]
<?php
function getPhpArrayToJsArray($array){
	$result = '[';
	for($i=0; $i<sizeof($array); $i++){
		if(is_array($array[$i])){
			$result .= getPhpArrayToJsArray($array[$i]);
			if($i<sizeof($array)-1){
				$result .= ',';
			}
		}else{
			if($i<sizeof($array)-1){
				$result .= $array[$i] . ',';
			}else{
				$result .= $array[$i];
			}
		}			
	}
	$result .= ']';
	$result = str_replace('][','],[', $result);
    return $result;
}

print getPhpArrayToJsArray(array('teste', array(array(1,2,3),'simples', array('mario', 'maria'))))
?>
[/code]