Answers for "php get img data from html"

PHP
3

php get src content from image tag

$html = '<img id="12" border="0" src="/images/image.jpg"
         alt="Image" width="100" height="100" />';

$doc = new DOMDocument();
$doc->loadHTML($html);
$xpath = new DOMXPath($doc);
$src = $xpath->evaluate("string(//img/@src)"); # "/images/image.jpg"
Posted by: Guest on June-29-2020
4

how to show image from php

<html>
 <head>
 <title>display image</title>
 </head>
 <body>
 <p>Here in your form and text</p>
	<?php
 
	echo "<img src='image-name.png' >"; 

	?>  
 </body>
 </html>
Posted by: Guest on July-07-2020

Browse Popular Code Answers by Language