I have a string 

`$cmd = "java -jar yuicompressor-2.4.8.jar --type *file_type* *original_file* > *new_file*";`

And I want to replace like below

`java -jar yuicompressor-2.4.8.jar --type css css/style.css > css/style.min.css`

What I did is 

```
$cmd = str_replace("*original_file*", $v, $cmd);
$cmd = str_replace("*new_file*", "$k", $cmd);
$cmd = str_replace("*file_type*", "css", $cmd);

```

I'm looking for a sort way like `preg_replace`. Any suggestion will be appreciated.