Hello WorldHello Worldhello world
or if the very beginning has spaceHello World
It works if $q has normal values but I am getting $q value from search input and so it does not work except case 1.
$q = Input::get('q');
if(preg_match("/^\s+/", $q) || preg_match("/\s{2,}/", $q)) {
echo 'Found Spaces';
}