php str_replace returns zero value

86 views Asked by At

I want to add some lines to many css files in different folders. everything is ok. but str_replace function returns zero value when write is with file_put_contents. This is my code:

$from = '@media (max-width: 767px) {';
$to = '.st'.$folder.' {}'. PHP_EOL .'.sb'.$folder.' {}'. PHP_EOL .'@media (max-width: 767px) {';
$item_content = str_replace($from, $to, $item_content);

Any idea? Thank you

0

There are 0 answers