hi, i have a list of words like this: Mon Apr 27 12 Tue Apr 28 15:43:24 20 Tue Apr Tue Apr 28 16:1 Tue Apr 28 09:38:31 Wed Apr 29 10 Wed Apr 29 2 Mon Apr 27 0 Wed Apr 29 21:1 Fri May Mon Apr Wed Apr and i want remove the wed apr and all data after the e-mail and keep only the e-mails. how can i do that? thanks a lot for your help
You can either use regex (regular expression) or just explode it. $str = "theisml35@berkleyintl.com Mon Apr 27 12"; list($email, $date) = explode(' ', $str);
$str = "theisml35@berkleyintl.com Mon Apr 27 12"; $space = strpos($str, " "); $new_str = substr($str, 0, $space); PHP: