Solved

How to concatenate strings in php?

Posted on 2011-03-11
6
254 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

623 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