title: PHP text replace? ( endings )
body: <p>original string: <code>$text = "aaaa aaaasomething someaaaa aaaa 89aaaa aaaathis"</code></p>
  
  <p>final result i need: <code>$textresult = "aaaa aaaasomething some4a aaaa 894a aaaathis"</code></p>
  
  <p>I mean: I want to replace any string on the text that ends with aaaa to 4a. But only if it is an ending and not an isolated string like aaaa or a string that starts with aaaa.</p>
  
  <p>I presume str_replace or preg_replace could eventually do this in a single code line but do not have idea how to do it.</p>
  
  <p>Thanks in advance!</p>