Divide a string

$string_to_divide = "This is the part of the string to keep: This is the part to be removed";
$dividing_character = ':';
$pos = strpos($string_to_divide, $dividing_character);
$divided_string = substr_replace($string_to_divide, "", $pos);

echo "Divided String = $divided_string";

0 Comments

You must be logged in to post a comment.