i want to set my array key initial value to a certain number.
here is what i have:
$tickets=array();
array_push($tickets,"10","20","TBD")
for($i=3; $i<20; $i++)
i want my array initial value to start at 3 not 0.
any ideas
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.
If you’re initializing $tickets right there why not use an array literal?
prints
edit and btw: This also works with variables in both places, the key and the value. Therefore
has the same output as well as