strstr

Find first occurrence of a string

<?php
$email  = 'name@example.com';
$domain  = strstr($email, '@');
echo  $domain;  // prints @example.com
$user = strstr($email, '@', true);
echo  $user;  // prints name
?>

Post to Twitter Post to Digg Post to Facebook Post to Google Buzz Send Gmail

Leave a Reply

Your email address will not be published. Required fields are marked *

*