Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6725247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:47:06+00:00 2026-05-26T09:47:06+00:00

I want to create tags using echo function but I’m stuck here; I dont

  • 0

I want to create tags using echo function but I’m stuck here; I dont know how to make it through.

This is what I want to do:

echo "<img src=$row['one'] style="width:100px"/>" ;

(Note: $row['one'] is a variable of php script and that contains the path of the image), but it throws me these error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampp\htdocs\im.php on line 13

I want these statement to execute in php and I tried this way too:

echo '<img src=$row['one'] styel="width:100px" />';

These time I get the error:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\im.php on line 13

I know where the error is. The error is most probably here

'<img src=$row[' //here's the error, right?

I worked on c and quite some other languages. I know that in c, to use double quotes in the printf we follow up some syntax but I dont know what to do in php.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:47:06+00:00Added an answer on May 26, 2026 at 9:47 am

    You need to escape the ":

    echo "<img src=\"{$row['one']}\" style=\"width:100px\" />";
    

    or you use single quotes and do this:

    echo '<img src="', $row['one'], '" style="width:100px" />';
    

    There is never a need to concatenate in order to echo. You can always just use ,. The php manual explains the differences between ' and " in the chapter on strings.

    As a goodie, because you mentioned printf, this works in php, too:

    printf('<img src="%s" style="width:100px"/>', $row['one']);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know is this possible to create hierarchy in web pages by
Using jquery, How can I create multiple draggables using loops through javascript? I want
I want to create a Java application bundle for Mac without using Mac. According
I want to create a client side mail creator web page. I know the
I want to create a function that performs a function passed by parameter on
I want to create inline SVG graphics using Javascript. However, it seems like createElementNS
Hi i want to create an uploading video program using youtube api I think
I am using multiple DIV tags with the same content to create one visible
I want to clean an HTML page of its tags, using Ruby. I have
I'm using PHP to create some basic HTML. The tags are always the same,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.