how to remove colon and white space in a string by php

Check This Code:

$demo_string =  "The Godfather: Part II";

$demo_string = str_replace(':', '', $demo_string);

$demo_string = str_replace(' ', '', $demo_string);

output : TheGodfatherPartII

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)