remove colon and white space in a string by php
$demo_string = "The Godfather: Part II"; $demo_string = str_replace(':', '', $demo_string); $demo_string = str_replace(' ', '', $demo_string);
Source: wordpress.stackexchange.com