SoLetztes Wort von String - Explode()? Ich versuche, das letzte Wort aus einem String zu bekommen ...
$pieces = explode(" ", $row["post_content"]);
print_r($pieces);
$customerEmail = array_pop($pieces);
echo "Email: " . $customerEmail."<br><br>";
$row["post_content"]
= I wish I could be the icing on the cake..whipped [email protected]
den Code Laufen bringt mich:
Array ([0] => I [1] => wish [2] => I [3] => could [4] => be [5] => the [6] => icing [7] => on [8] => the [9] => cake..whipped [email protected]) Email: cake..whipped [email protected]
Ich will das Ende das Array, um nur die E-Mail wiederzugeben. Warum enthält es vor der E-Mail, wenn ich array_pop()
? Ich möchte nur die E-Mail.
funktioniert für mich: http://ideone.com/rlxGeB vielleicht ist es kein regulärer Raum? – nogad
Sie können etwas wie diese https://eval.in/779902 ausführen, um zu sehen, was Ihre Charaktere tatsächlich sind. – chris85