logo SnippetVamp

php 141css 88fonctions 82astuce 77javascript 70html 56fichiers 35jquery 31securite 19texte 17bootstrap 14parser 14debug 12graphisme 11python 11responsive 8pluXML 7bash 6PHP 6crossbrowser 4vanilla 4ajax 3mail 3markdown 3mobile 3regex 3apache 2auto_ 2browser 2conversion 2error 2evenements 2excel 2form 2ips 2lib 2linux 2SQL 2vba 2cinema 1compteur 1dothtaccess 1effets 1erreurs 1fallback 1filter 1images 1pluxml 1social 1SQLite 1xml 1
SnippetVamp 3.1b - 2025 - GNU GPL - FAQ
#key - Ajouter http à une URL si nécessaire - Warrior du Dimanche
#Ajouter http à une URL si nécessaire
#http://warriordudimanche.net

function add_protocol($url,$protocol='http://'){
	if (preg_match('#^([ftphs]+://)([^ ]+)#',$url,$results)){return $url;}else{return $protocol.$url;}
}




			
php
http://www.warriordudimanche.net/article156/ajouter-http-a-une-url-si-necessaire
public - 12/05/2013 - Add to pack - texte seul - permalink