PHP code example of studiow / placeholder

1. Go to this page and download the library: Download studiow/placeholder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

studiow / placeholder example snippets


$image = new Studiow\Placeholder\Image(300, 250);

echo (string) $image; //will write 'https://via.placeholder.com/300x250

$resized = $image->width($new_width)->height($new_height);

$resized = $image->format('jpg');

$white_background = $image->background('ffffff');
$black_text = $image->color('000');

$withText = $image->text('My Image Text');