title: What would be php equivalent of this code?
body: <pre><code>var okTags = /^(&lt;\/?(b|blockquote|code|del|dd|dl|dt|em|h1|h2|h3|i|kbd|li|ol|p|pre|s|sup|sub|strong|strike|ul)&gt;|&lt;(br|hr)\s?\/?&gt;)$/i;
  
  var okLinks = /^(&lt;a\shref="(\#\d+|(https?|ftp):\/\/[-A-Za-z0-9+&amp;@#\/%?=~_|!:,.;\(\)]+)"(\stitle="[^"&lt;&gt;]+")?\s?&gt;|&lt;\/a&gt;)$/i;
  
  
  var okImg = /^(&lt;img\ssrc="https?:(\/\/[-A-Za-z0-9+&amp;@#\/%?=~_|!:,.;\(\)]+)"(\swidth="\d{1,3}")?(\sheight="\d{1,3}")?(\salt="[^"&lt;&gt;]*")?(\stitle="[^"&lt;&gt;]*")?\s?\/?&gt;)$/i;
  
  
  text = text.replace(/&lt;[^&lt;&gt;]*&gt;?/gi, function (tag) {
                      return (tag.match(okTags) || tag.match(okLinks) || tag.match(okImg)) ? tag : ""
                  })
  </code></pre>