/    Sign up×
Community /Pin to ProfileBookmark

Calling Image! in PHP

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

in the simpliest form

echo “/image/id.gif” is this correct<

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@ryanlundAug 07.2009 — Just put it like you would in html

so you would put

[code=php]
echo "<img src='image/id.gif' alt='alt text' />";
[/code]
Copy linkTweet thisAlerts:
@JunkMaleAug 07.2009 — Or does he mean how do you output an image you have made on the fly...
Copy linkTweet thisAlerts:
@ryanlundAug 07.2009 — Not sure tbh, doesnt look like it though
Copy linkTweet thisAlerts:
@JunkMaleAug 07.2009 — You never know... many strange things happen in cyberspace...
Copy linkTweet thisAlerts:
@MichaelttkkAug 09.2009 — in how I get it
[code=php]echo "<img src='image/id.gif' alt='alt text' />";[/code]

link
[code=php]echo "<a href='<img src='image/id.gif' alt='alt text' /></a>'";[/code]
Copy linkTweet thisAlerts:
@thraddashAug 09.2009 — The easiest way to do it is just:

[code=php]echo '<img src="/image/id.gif" alt="" />';[/code]

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.

[code=php]echo
'<a href="index.htm">' .
'<img src="/image/id.gif" alt="" />' .
'</a>';[/code]
×

Success!

Help @mb00140804 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...