The \s character class will match whitespace characters. I've added the + quantifier to collapse multiple whitespace to one _. If you don't want that, remove the +
$picture =preg_replace('/\s+/', '_', uniqid()."_".$image_name);
$picture =preg_replace('/\s+/', '_', uniqid()."_".$image_name);
0 komentar:
Post a Comment