comme je suis zero en php
j'éprouve de la difficulté a remplacer ou a supprimer une ligne dans un php avec str_replace
voici la ligne en question
Code : Tout sélectionner
<header <?php if($this->getData(['theme', 'header', 'position']) === 'hide'): ?>class="displayNone"<?php endif; ?>>
Code : Tout sélectionner
<?php
$file = $_SERVER['DOCUMENT_ROOT'] .'/testreplace.php';;
$cherche = '<header <?php if($this->getData(['theme', 'header', 'position']) === 'hide'): ?>class="displayNone"<?php endif; ?>>';
$remplace = '';
$filecontent=file_get_contents($file);
$replace=str_replace("$cherche", "$remplace", $filecontent );
file_put_contents($file, $replace);
?>
Parse error: syntax error, unexpected 'theme' (T_STRING) in C:\xampp\htdocs\test.php on line 3
et il possible de me donner un coup de main? merci d' avance..