I am new to PHP and I can't figure how function return array, I have two similar arrays, one hand defined and one return by a function but the first doesn't work after whereas the first does...
Here is my code :
<?php
function fileContent($file) {
if(file_exists($file)){
$arr = file($file) ;
return($arr);
}
else{
echo "This file doesn't exist";
}
}
$values=fileContent("Ressources/myfile.txt");
print_r($values);
?>
<?php
$values= Array("Val1","Val2","Val3");
print_r($values);
?>
myfile.txt :
Val1
Val2
Val3
Both print_r show the same but then when I try to use the array with the one from the function, I can't do anything...