Hello I want to get user from an email address,
eg: sajid@webspot.com then output must be sajid
for this i use below mentioned code
$user = strstr($email, '@', true);
but an warning occur
Warning: Wrong parameter count for strstr() in /var/www/DataTable/dialog.php on line 3
& in php manul it is clearly define that the 3rd argument true is only valid for PHP 5.3.0
So is there any string function which could solve my problem?
$user = substr($email, 0, strpos($email, '@'));
Look in the User Generated Comments on the manual page, there are a few implementations.
$name=strtok($email,"@");