Hyvor Developer
  Home   Download   Copy
Code
<?php
$str = '06:45:12';
$regex = '/\d/';
echo preg_replace($regex, 'n', $str); // returns "nn:nn:nn"

echo "<br>";

$str = 'How are you?';
$regex = '/\s/';
echo preg_replace($regex, '', $str); // returns "Howareyou?"
Result