Search text for specific keywords at start and end in php
<p>I have the following string </p>

<pre><code>$url_part = 'p=link&amp;u=shuja&amp;sort=recent';
</code></pre>

<p>I want to get string start with p= and end with &amp; in such a way,</p>

<pre><code>$page = 'link'; 
</code></pre>

<p>and it may exist anywhere in $url_parts. Then remove the same like that</p>

<pre><code>$url_part = 'u=shuja&amp;sort=recent';
</code></pre>
