Skip to content

Instantly share code, notes, and snippets.

@tubalmartin
Created May 13, 2012 17:27
Show Gist options
  • Save tubalmartin/2689388 to your computer and use it in GitHub Desktop.
Save tubalmartin/2689388 to your computer and use it in GitHub Desktop.
PHP function that prints an image to be used by Riloadr
<?php
function print_image($data_src, $noscript_src, $group_class = "responsive", $classes = "", $alt = "", $data_base = "")
{
echo '<img alt="'.$alt.'" class="'.$group_class.' '.$classes.'" data-src="'.$data_src.'"'.(!empty($data_base) ? ' data-base="'.$data_base.'"' : "").'>'.
'<noscript>'.
'<img alt="'.$alt.'" class="'.$classes.'" src="'.$noscript_src.'">'.
'</noscript>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment