Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

PHP strstr — Find the 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
?>
 
PREVIOUS NEXT
Tagged: #PHP #strstr #Find #occurrence #string
ADD COMMENT
Topic
Name
7+6 =