How do I create in PHP with the intervention an image server type the Placehold.it? Like that when I write the HTML tag inside the src I give an address that should return an image.
Ex:
<img src="http://meusite.com/350x150">
How do I create in PHP with the intervention an image server type the Placehold.it? Like that when I write the HTML tag inside the src I give an address that should return an image.
Ex:
<img src="http://meusite.com/350x150">
I'm not that stuff in php, but I know there is the GD ( link ) in php
Dynamically creating image using the get (? width = 300 & height = 300) method:
<?php
header("Content-type:image/png"); // Informa ao nevagador que se trata de uma imagem png
$imagem=imagecreate($_GET["width"],$_GET["height"]); // Cria a imagem com as dimensões definidas
$preto=imagecolorallocate($imagem,0,0,0); // Cria um fundo preto
$branco=imagecolorallocate($imagem,255,255,255); // Armazena uma cor
imagestring($imagem,10,8,8,$_GET["width"]."x".$_GET["height"],$branco); // Escreve na imagem
imagepng($imagem);
imagedestroy($imagem);
?>
Then just call it inside an img tag, for example:
<img src="imagem.php?width=800&height=600">