I have an array
$a = array('a', 'b', 'c');
What is the shortest and optimum way to change it to
$a = array('1a1', '1b1', '1c1');
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.
With a dynamic number of values you must use a loop
(I know: Omitting the braces
{}is usually not “a good style”, but in such simple cases there is nothing wrong with it. Of course you can add the braces again, if you don’t feel comfortable with the compacted form).or (with PHP5.3)