I’m new to PHP, and I can’t figure out this basic question. Does PHP have some sort of set or list object? Something like an array, but with the ability to dynamically add or remove any number of objects from it.
Share
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.
Yes, you could use the array object and the array functions.
Basically, you could dynamically grow an array using the array_push function, or the
$arrayName[] = ...notation (where arrayName is the name of your array).