I don’t figure out how to do something ... In general, there is a variable that contains a string of text. It is necessary in this line to replace *.css with template/*.css .

    2 answers 2

     $str = preg_replace('/([^/]+\.css)/', 'template/$1', $str); 
    • As I understand it, the asterisk is an element of the string. Those. $str = preg_replace('/\*\.css/', 'template/$0', $str); - alexlz
    • It gives an error, but based on this, I got what I need, thank you. [code] $ page = preg_replace ("/ ([- a-zA-Z0-9] + \. css) /", "template / $ 1", $ page); [/ code] - Andrey Talanin
    • I beg your pardon, I forgot the parenthesis, yes - Sh4dow
     $str = str_replace("*.css", "template/*.css", $str);