Answer the question
In order to leave comments, you need to log in
How to get multiple rows from an array?
Hello! I have an array like this:
Array
(
[0] =>
[1] => animals
[2] => cats
[3] => food
[4] => purina
[5] => product
[6] => golden
)
/animals/cats/food/purina/product/golden
/animals
/animals/cats
/animals/cats/food
/animals/cats/food/purina
Answer the question
In order to leave comments, you need to log in
The code must be written in the head. Well, sometimes help yourself with your hands.
foreach($array as $ar){
$string = $string.'/'.$ar;
echo $string;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question