how to deal with a sentence as a page title?

<?php
$hotel=”  How to study PHP  “;
$hotel= trim($hotel);
$array=explode(” “, $hotel);

$hotel=implode(“-“, $array);
echo ($hotel);
?>