<?php

$string = 'MyHomeIsHere';
$regex = '~		# delimiters
		\B 		# match where \b does not match
		[A-Z]	# one of A-Z
		~x';	# free spacing mode for this explanation

$words = preg_replace($regex, ' $0', $string);
echo $words;
?>