Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to concatenate strings in php?

Posted on 2011-03-11
6
Medium Priority
?
257 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 2000 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: 35113709
Ok, nevermind I got it. Another silly mistake!
0
 
LVL 16

Expert Comment

by:sjklein42
ID: 35113719
no prob.
0

Featured Post

Tutorial: Introduction to Managing a Linux Server

In this tutorial on systemd, we will explore:
-OS/Distro Adoption
-chkconfig and Other Legacy Commands
-Summary and Key Commands

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
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)
Suggested Courses

730 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