title: How to clear everything after certain character in string php?
body: <p>I have few functions that sanitize everything in get and post but this one must be bit more specific , I have an array that is producing links  like </p>
  
  <pre><code>array(
    1 =&gt; http://site/something/another/?get_something=1
    2 =&gt; http://site/something/another2/?get_something=1
  )
  </code></pre>
  
  <p>also have a function that is sanitizing get and post but that function would clear everything from this array values so I am left with  </p>
  
  <p>httpsitesomethinganotherget_something1</p>
  
  <p>can someone please help to match EVERYTHING  after <code>get_something=</code>
  and clear it or replace it with get_something=1 , something like </p>
  
  <pre><code>$clear = preg_match('/^[A-Za-z0-9]+$/', $array[1]);
  preg_replace("/get_something=".$clear."/i","",$array[1]);
  </code></pre>