title: PHP preg_replace any number starting with $ by xxx
body: <p>I want to replace every occurrence of $(any number) in text by xxx. E.g if there is occurrence of $923 in text then it should be xxx.</p>
  
  <p>Patterns I have tried</p>
  
  <pre><code>                    $string = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. $350 remaining essentially unchanged. It was popularised in the 1960s with the release of $90 required Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";
  
                      $pattern = '/^\$[0-9]+\.?[0-9]?[0-9]/i'; 
  
                      $pattern = '/($\[0-9]+)/';
  
                      $replacement = "xxx";
                      echo preg_replace($pattern, $replacement, $string);
  </code></pre>