You are viewing the category: PHP

PHP: Convert Html Entities to Xml Entities

I have made a small change to this great function by regin (via sourcerally.net) to use the preg_replace instead of str_replace as I found it to be much faster when dealing with large xml files. This function comes in handy when creating xml files  and you need to quickly convert all the html entites to […]

Changing to a new domain?

If you are moving your site to a new domain name and want to redirect all your current traffic as well as inform all of the search engines as they crawel your site of the move to the new, you can place the following code in your main include file or each file individually. if($_SERVER[‘HTTP_HOST’] != “www.your-new-domain-here.com“){   header( “HTTP/1.1 301 […]