Answer the question
In order to leave comments, you need to log in
Where is the error in the foreach function?
Please help me solve the problem.
There is a $f variable with arrays
Example
Array
(
[0] => Array
(
[0] => 1 2 3
)
[1] => Array
(
[0] => робот
)
[2] => Array
(
[0] => toster
)
)
foreach ($f as $rok) {
$trans = "".$rok.".html";
if (file_exists($trans)) {
} else {
file_put_contents($trans, $rok);
}
}
Answer the question
In order to leave comments, you need to log in
PHP Notice: Array to string conversion in /home/sashka/test1.php on line 14
foreach ($f as $rok) {
$trans = "".$rok[0].".html";
if (file_exists($trans)) {
} else {
file_put_contents($trans, $rok);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question