Hello!
There is a piece of code
if (substr($key,0,4) == "AIR/" && in_array(substr($key,4,3),array("123","321","567","894","111","222","564","864"))) { echo "\n* $key *\n"; which ultimately displays the values in this form:
* AIR/564-0000906c * * AIR/321-00008cab * * AIR/222-0000806f * * AIR/111-00009067 * Please tell me how to count the $ key before the output. I need to get the number of how many values there, the asterisk * serves as a separator, because it displays everything on one line, and I don’t know how this can be calculated.
I thought, maybe counting how many in the line AIR / will meet, such a number will come out, but it still does not work out for me. Tried to count through count ($ key), but it displays 1, because it probably counts the entire line.
Help.
I tried this:
$n = $n + 1; echo "\n* $n *\n" ; displays
* 1 * * 2 * * 3 * * 4 * I need to get a finite number of 6, because even if I make $ n, it will give me units.