Advertisement
jiue123

syntax strstr() PHP

Sep 29th, 2014
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.21 KB | None | 0 0
  1. <?php
  2. $email  = 'name@example.com';
  3. $domain = strstr($email, '@');
  4. echo $domain; // result: @example.com
  5. echo "</br>";
  6. $user = strstr($email, '@', true); // As of PHP 5.3.0
  7. echo $user; // result: name
  8. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement