remove blank spaces php arrra code example Example: remove empty spaces php $string = str_replace(' ', '', $string);