Salve il seguente script mi da l'errore che non capisco...
<?php
for ($i=0; $i<9; $i=$i+1) {
$nome="array"."$i";
$nome[] = "okokokok";
}
function permutate(&$array) {
$len = sizeof($array);
$permArray = array();
for($i = 0; $i < $len; $i++) {
perm($array[$i], $i, $len, $array, $permArray);
}
for($i = 0; $i < sizeof($permArray); $i++) {
echo $permArray[$i]."
";
}
}
function perm($str, $index, $length, &$elementArray, &$permArray) {
if($index == $length)
return;
$permArray[] = $str;
for($j = $index; $j+1 < $length; $j++) {
perm($str.$elementArray[$j+1], $j+1, $length, $elementArray, $permArray);
}
}
for ($i=0; $i<9; $i=$i+1) {
permutate($nome);
}
?>
Errore:
Fatal error: [] operator not supported for strings in /home/italyhot/public_html/permutate.php on line 5
Come fare per procedere???![]()