Code PHP:
$url = 'https://toto.fr';
$pos = strpos($url,'//');
$pos = ($pos==false) ? 0 : $pos+2;
$url = '//' . substr($url, $pos);
echo $url;
$url = 'https://toto.fr';
$pos = strpos($url,'//');
$pos = ($pos==false) ? 0 : $pos+2;
$url = '//' . substr($url, $pos);
echo $url;
$value = $page->getFieldValue('URL');
if (stristr($value, 'http://') === false && stristr($value, 'https://') === false) {
// Determine si site supporte SSL. (Donc j'en concluais https)
$uri = JURI::getInstance();
$scheme = $uri->toString(array('scheme'));
$value = $scheme . $value;
}
?>
<div class="thisinfo" style="color:#333;font-size:12px;display: <?php echo $displayURL; ?>;"> <a href="<?php echo $value;?>" target="blank" class="o-nav__link t-text--muted"> <i class="es-side-widget__icon fa fa-globe t-lg-mr--md"></i> <?php echo $page->getFieldValue('URL'); ?> </a> </div>
<?php
$URL = "www.sete.fr";
$uri2 = JURI::getInstance($URL);
echo $uri2; ?>
Laisser un commentaire: