I am new to PHP and wants to know whether array’s in PHP are LIFO or FIFO. For e.g.
$var1 = array('1','2','3');
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
They are what you make them 🙂
array_pop()removes an item off the end of an array (the last item that was added)array_shift()removes the first item off the array (first one added).So as you can see they are capable of behaving in both ways.
It all depends on how you implement your code.