Mac
New Member
- Feb 9, 2011
- 111
- 2
Hello , today i will show you how to show images in PHP without using HTML like that :
That code is still using HTML .
Here's the code without HTML (Look at it and then i will explain it!).
Okay ! You are going to create a variable which it's value will get content of the image using "file_get_contents()" function. In the brackets you are going to make quotes and write image's url or link (starting with http:// (
Php code (OOP) for that : (NO EXPLAIN FOR THIS)
Thanks , for questions comment/reply
PHP:
<?
echo "<img src='IMAGE LINK'></a>";
?>
Here's the code without HTML (Look at it and then i will explain it!).
PHP:
<?
$image = file_get_contents("IMAGE LINK");
echo $image;
?>
You must be registered for see links
) like that "file_get_contents("http://images.com/image.gif");"Php code (OOP) for that : (NO EXPLAIN FOR THIS)
PHP:
<?
class Image {
function show_image($string) {
echo file_get_contents($string);
}
}
$image = new Image;
$image->show_image("IMAGE LINK");
?>
Thanks , for questions comment/reply