www.webdeveloper.com
Results 1 to 7 of 7

Thread: Calling Image! in PHP

  1. #1
    Join Date
    Aug 2009
    Posts
    5

    Calling Image! in PHP

    hmm! can somebody help me echoing image in php?!

    in the simpliest form

    echo "/image/id.gif" is this correct<

  2. #2
    Join Date
    Mar 2009
    Location
    Yorkshire
    Posts
    266
    Just put it like you would in html

    so you would put

    PHP Code:
    echo "<img src='image/id.gif' alt='alt text' />"

  3. #3
    Join Date
    Jan 2009
    Location
    Insanity
    Posts
    1,131
    Or does he mean how do you output an image you have made on the fly...

  4. #4
    Join Date
    Mar 2009
    Location
    Yorkshire
    Posts
    266
    Not sure tbh, doesnt look like it though

  5. #5
    Join Date
    Jan 2009
    Location
    Insanity
    Posts
    1,131
    You never know... many strange things happen in cyberspace...

  6. #6
    Join Date
    May 2003
    Posts
    144
    in how I get it
    PHP Code:
    echo "<img src='image/id.gif' alt='alt text' />"
    link
    PHP Code:
    echo "<a href='<img src='image/id.gif' alt='alt text' /></a>'"
    Last edited by Michaelttkk; 08-09-2009 at 09:07 AM.
    Learning never ends!

  7. #7
    Join Date
    Aug 2009
    Posts
    593
    The easiest way to do it is just:

    PHP Code:
    echo '<img src="/image/id.gif" alt="" />'
    Only use double quotes if you intend on parsing your string, otherwise single quotes will do.
    The "link" suggestion by Michaelttkk looks incorrect, just add <a> tags around the <img> tag.

    PHP Code:
    echo
        
    '<a href="index.htm">' .
            
    '<img src="/image/id.gif" alt="" />' .
        
    '</a>'
    Last edited by thraddash; 08-09-2009 at 09:22 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles