how to remove a string starting from ‘@’?
for example admin@admin.com, i want to remove the string starting from @ so it becomes ‘admin’ only.
just like in twitter..i read about str replace and trim but i think theres other way to do it?
$email = 'admin@admin.com';
echo substr_replace($email, ?, ?) ; this i cant do
You don’t need to replace the remainder, you can just cut out until the searched character. In this case it’s very easy with strtok: