I have this array loop:
foreach ( $event_entrance as $event_entrance_s ) {
_e($event_entrance_s,'holidayge');
echo ', ';
}
I’d like to ger rid of comma at the end of the last loop.
Any ideas? Seems simple, but it isn’t for me 🙂
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.
What about…
As long as your keys are integers and sequential, this should work exactly as you intend. If you’re using integers, but they are not in any particular order, putting this before your
foreach()loop will fix that:If you are using strings as keys instead of integers, try something like this: