Posts tagged PHP5

UTF encoding in PHP for DOMDocument::loadHTML

0
While parsing a HTML page, I was loading the dom using loadHTML() but some of the text was coming all garbled. Google led to PHP online documentation and after a few suggestion ggiven there this one worked for me just perfectly:
DOMDocument::loadHTML
To summarize, you have to ensure that the meta tag specifying charset should be on top.

(more…)

Do you enjoy this blog? Do you find the information helpful? Then go ahead and treat me to a coffee or send me a tip! I love Barista's Cappuccino Cookie n Cream . Choose any amount you wish, whatever you feel this blog is worth to you.

Parse HTTP Headers in PHP

5

Like most of the times, almost all my posts have something to do with whatever I am currently working on. Needed to parse HTTP headers in PHP and the function given in the manual required PECL which sadly was not available on my server. If you don’t have access to the PECL, here is a way to parse the headers.
(more…)

Do you enjoy this blog? Do you find the information helpful? Then go ahead and treat me to a coffee or send me a tip! I love Barista's Cappuccino Cookie n Cream . Choose any amount you wish, whatever you feel this blog is worth to you.

How to Get Current URL in PHP

0

Recently needed to get URL of the page I was on. Here is the code to get that> It works fine for Apache on Linux. Have not tested it for IIS or Apache on windows.

(more…)

Do you enjoy this blog? Do you find the information helpful? Then go ahead and treat me to a coffee or send me a tip! I love Barista's Cappuccino Cookie n Cream . Choose any amount you wish, whatever you feel this blog is worth to you.

  • Cumulus

  • Tweets

Go to Top