Skip to content

Instantly share code, notes, and snippets.

@andrearufo
Created October 28, 2014 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrearufo/b1e515576750bcc51c6e to your computer and use it in GitHub Desktop.
Save andrearufo/b1e515576750bcc51c6e to your computer and use it in GitHub Desktop.
Random Unsplash image resized
<?php
// return the url of a random unsplash image with selected size
function fakeimg($w, $h, $last=495){
if(!isset($h)) $h = $w;
return 'https://unsplash.it/'.$w.'/'.$h.'/?image='.rand(0,$last);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment