title: remove year (yyyy) from string in php
body: <p>I cant get the regex to identify the date from a string and remove it with string replace:</p>
  
  <pre><code>&lt;?php
  
  $string = "keywords=2012+some+words";
  
  echo $string ."&lt;br /&gt;";
  
  $new_string = str_replace("keywords=/^([0-9]{4})$/","keywords=",$string);
  
  echo $new_string ;
  ?&gt;
  </code></pre>
  
  <p>I have read this post <a href="https://stackoverflow.com/questions/6073218/regex-to-remove-year-from-a-string-php">Regex to remove year from a string PHP</a></p>
  
  <p>and just cant get it to work</p>