Location: PHPKode > projects > Batavi > batavi/ext/smarty/plugin/modifier.url_exists.php
<?php

/**
 * file modifier.url_exists.php
 *
 * @copyright Copyright (c) 2009, ICEshop BV
 *
 */

/**
 * smarty url_exists modifier plugin
 *
 * @param string $url
 * @return boolean
 */

 function smarty_modifier_url_exists($url) {
   if (substr($url, 0,7) != 'http://' && substr($url,0,6) != 'ftp://') {
     $url = DIR_FS_ROOT . $url;
   }
   $handle = false;
   $handle = @fopen($url,'rb');
   if ($handle == false) {
     return false;
   } else {
     @fclose($handle);
     return true;
   }
 }

?>
Return current item: Batavi