note 26477 deleted from function.strstr by nlopess

From: Date: Tue, 07 Jun 2005 14:25:17 +0000
Subject: note 26477 deleted from function.strstr by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-90068@lists.php.net to get a copy of this message
Note Submitter: crypto at notup2u dot net ---- Here is a small command to get the beginning of a string until another string. This is a bit like strstr() but it returns the beginning and not the end of the string ! Voici une petite commande pour obtenir le début d'une chaine de charactères jusqu'à une autre chaine. C'est un peu comme strstr() mais celà retourne le début et non la fin de la chaine ! $string = "email@domain.net"; $separat = "@"; $string = substr($string, 0, strlen($string)-strlen (strstr ($string,$separat))); // $string : "email" /Crypto

« previous php.notes (#90068) next »