Answer the question
In order to leave comments, you need to log in
How to do it correctly so that when splitting a string into an array, build a cycle inside that would meet certain requirements?
Let's say there is a string that we split into an array and check the size of the array, so that we can then use this array to form a multidimensional array:
$_str = 'key01$key02';
$_arr = implode('$', $_str);
$_line = array();
if (count($_arr) > 1) {
$_line[] = $_data[$_arr[0]][$_arr[1]];
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question