Grep duplicate JSON keys
If you have large JSON files with application settings in, you need to be sure that the settings only appear once. Not a problem until you get to the stage…
A bunch of ramblings about PHP programming, JQuery, MySQL and other 'stuff'
If you have large JSON files with application settings in, you need to be sure that the settings only appear once. Not a problem until you get to the stage…
You cannot strip a certain list of tags with PHP’s strip_tags() function, you can only strip ‘all but’ tags. So in order to do so, you’ll need to use regular…
This horrendous regular expression will parse a string and return a valid email address from it. $email = "<'Freddy'> fred@live.com"; preg_match('/+(?:\.+)*@(?:(?:*)?\.)+(?:*)?/', $email, $match); echo $match; This will return: fred@live.com Basically,…
I’ve found an excellent online tool, where you can give it a regex, and it will spit out the PHP syntax for use with preg_replace, preg_match, etc. I’m forever getting…
Say you have a list of movie titles, and you want to either sort them, or search through them, and some of them have “The ” at the start, for…
Regular expressions — everyone loves them, right? Well, I am currently running Ubuntu, and I would normally use RegexBuddy – but cannot unless I use Wine, and I don’t really…