explode returns an array. explode will break the given string in to parts using given character(here its ~) and will return an array with the exploded parts.
$a = "hello~world";
$str_array = explode("~",$a);
$first = $str_array[0];
$second = $str_array[1];
echo $first." ".$second;