Snippets

code examples and practical uses of code. A less general topic.

Categories
http://stackoverflow.com/questions/7454644/how-to-get-open-graph-protocol-of-a-webpage-by-php

stackoverflow.com/questions/7454644/how-to-get-open-graph-pr...

PHP has a simple command to get meta tags of a webpage (get_meta_tags), but this only works for meta tags with name attributes. However, Open Graph Protocol is becoming more and more popular these days. What is the easiest way to get the values of opg ...

Visited123
http://stackoverflow.com/questions/1703320/remove-excess-whitespace-from-within-a-string

stackoverflow.com/questions/1703320/remove-excess-whitespace...

I receive a string from a database query, then I remove all HTML tags, carriage returns and newlines before I put it in a CSV file. Only thing is, I can't find a way to remove the excess white space from between the strings.

What would be the b ...

Visited186
http://stackoverflow.com/questions/5749415/search-for-a-string-or-part-of-string-in-php

stackoverflow.com/questions/5749415/search-for-a-string-or-p...

I am doing a very small online store application in PHP. So I have an array of maps in PHP. I want to search for a string (a product) in the array. I looked at array_search in PHP and it seems that it only looks for exact match. Do you guys know a bett ...

Visited145
http://www.hashbangcode.com/blog/uk-postcode-validation-function-php

www.hashbangcode.com/blog/uk-postcode-validation-function-ph...

Creating a function to validate UK postcodes would seem like a simple task, but there is a little more to it than checking the number of characters. In fact there are several different variants of UK postal codes, especially if you include BFPO and ove ...

Visited115