Solved

How to concatenate strings in php?

Posted on 2011-03-11
6
253 Views
Last Modified: 2012-05-11
Hello, this string is not working for me:

for ($i = 0, $i < 3; $i++)  {
      echo "<img src=\"" . $pictures[$i] . "\" />";
}

Does anyone have any suggestions?
0
Comment
Question by:FairyBusiness
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 16

Accepted Solution

by:
sjklein42 earned 500 total points
ID: 35113661
The bug is in the for statement.  You have a comma instead of a semi-colon after the $i=0.

0
 

Author Comment

by:FairyBusiness
ID: 35113685
Thanks! Maybe you can help me with my next question.
0
 
LVL 16

Expert Comment

by:sjklein42
ID: 35113700
Post it as a "related question" (or link to it here) and I'll take a look.  Thanks.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:FairyBusiness
ID: 35113703
0
 

Author Comment

by:FairyBusiness
ID: 35113709
Ok, nevermind I got it. Another silly mistake!
0
 
LVL 16

Expert Comment

by:sjklein42
ID: 35113719
no prob.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to dynamically set the form action using jQuery.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question