How do I add to the beginning of an array and find the number of elements in it?
$values = array(2,3,4,5,6,7,8,9,10);
$elements = array_unshift($values,1);
echo "Number of elements: $elements \n\n";
Here's the output:
Number of elements: 10
 => 1
 => 2
 => 3
 => 4
 => 5
 => 6
 => 7
 => 8
 => 9
 => 10
More arrays PHP QuestionsHow do I sort alphanumeric array data correctly?
I have an array of a hundred or so lines, each line has data with "|" separated values. I need to scan through this array, and select the line whose first 5 characters matches a text string. Any ideas or questions?
OK I've been trying to echo out the arrays "$people and $other people" using the for-each method in alphabetical order. but when i see what this displays it does it in some other order. THIS IS THE CODE PHP Ch8 Lab
how can you reset an array in PHP
How do I find out if a value is already in an array?