- substr: documentation ( source)
- print_r: documentation ( source)
- explode: documentation ( source)
- strrpos: documentation ( source)
<?php
$string = "Hello world; This is a nice day; after";
$str = explode(";",$string);
$size=sizeof($str);
$newstr = array();
$newstr[0] = $str[$size-1];
$newstr[1] = "--".substr($string, 0, strrpos($string, ";"))."--";
print_r($newstr);