Parse string as a query string
There has been an odd occasion in the past where I have used a string (Note: not the query string) in order to form a settings class in some way or another. I didn’t realise that there was a built in PHP function for this, and is only through reading through most of the PHP string functions that I came across it (and many other interesting functions).
The times of doing this are long gone (Am using the query string here just for clarity):
- <?php
- foreach (explode('&', $_SERVER['QUERY_STRING']) as $chunk) {
- $chunk = explode('=', $chunk);
- $variables[$chunk[0]] = $chunk[1];
- }
And I am now saying “hello” to this:
- <?php
- $variables = parse_str($_SERVER['QUERY_STRING']);
SimpleXML
One thing I have found is the lack of really simple XML classes—that’s not to say there aren’t any good ones out there, I have used several really cracking ones. For my new version of my personal site (yes, this site is planned for a revamp) I wanted to integrate my Twitter feed somewhere. I looked and looked for a really simple XML class but was unable to find one. So I made one. And here is the result:
Safari: the hidden developer tools
I’m a developer. A such I require tools to help me, such as Web developer and Firebug. However, Firefox has become so unstable for me that I have been forced over to Safari. There are a lot of things I miss from Firefox:
- Cmd+Shift+T to reopen the last closed tabs
- Cmd+U view source.
- The “Add bookmark here” extension.
- Web developer
- Firebug
- Right clicking on an image > properties.
- Saving form credentials, and providing it in an easy to use place (No, I don’t count Keychain as an easy to use place).
Dictionary.app quick tip
One of the reasons I love OS X is that everything is thought out. One quick example of this is something I learnt a couple of months ago on one of my very infrequent visits to Digg, in any Cocoa or Carbon application, hover your cursor over a word and hit Command+Control+D.
Voila!
Instant access to Dictionary.app without opening it, presented in a very user friendly way, with links to see other information such as from a Thesaurus or Wikipedia.
Huzzah: new news
The BBC has finally rolled out its new news site, months after it updated its main homepage. And I like it, except there are a lot of points which I don’t.
Want me to talk about something in particular? Drop me a line and I may just do that.
