<?php $str = " Hi, my name is Petr"; echo preg_replace(array('/^\s+/', '/\s+/'), array('', ' '), $str) . "\n"; echo preg_replace('/(?<=^|\s)\s+/', '', $str);
You have javascript disabled. You will not be able to edit any code.