Php grabs a word of the string, does not replace it, and adds <br>

assume that the string is

abc@gmail.com
    Can
  1. realize the name of the string before catching @? (abc) no matter how long.
  2. Can
  3. automatically add a
    before each string @? It will not replace any Kansi.
abc
@gmail.com
Mar.01,2021

$abc = "12ww@qq.com";
$a = strpos ($abc, "@");
$str = substr ($abc,0,$a). "
" .substr ($abc,$a);


$email = 'abc@gmail.com';
$email = str_replace("@","<br>@",$email);

$email = 'abc@gmail.com';
$arr = explode ("@", $email);
echo $arr [0], "
",' @'. $arr

Menu