Parallels Plesk Documentation
How to read the contents of a file into a string in PHP
file_get_contents() can help us here. It reads a file and stores it in a string. Can be used with local files, as well as online content: $myLocalFile = file_get_contents(‘myfile.html’); $myOnlineFile = file_get_contents(‘http://wpguru.co.uk’); echo myOnline File; // would display the actual website This is different from the file() function which reads the contents of a file … Read more
How to replace text inside a string in PHP
If we have a string and would like to replace a portion of it, we can use the str_replace() function in PHP. It works like this: str_replace (‘whatToReplace’, ‘theReplacement’, ‘originalText’); It’s easy to remember… but I always get confused when I look this up in the manual. Here’s an example: $originalText = “Now is the … Read more
How to convert a timestamp into a readable date in PHP
A UNIX timestamp is something like a 10 digit (or less) integer number which represents the elapsed seconds since the 1st of January 1970 (also known as the Unix Epoch). It’s a very accurate representation of time, but not necessarily something us humans easily understand. A Unix Timestamp looks something like 1367805780. We can use … Read more
How to auto indent and collapse source code in Dreamweaver
I keep forgetting where and how to find this feature. Turns out the Command menu gives us such features: Commands – Apply Source Formatting (to Selection) Applies the correct indentations to the entire file, or your selection only. It’s the equivalent of Xcode’s “Editor – Structure – Re-Indent”. To manually move blocks of code, select … Read more
https twitter com versluis status 401044409061765120
@BarackObama Do you need help with that website? Let me know – I'm happy to help!
— Jay Versluis (@versluis) November 14, 2013
How to react to multiple UIAlertViews
If your class creates more than one UIAlertView, then you need a way to react to each of those accordingly. Problem is, you may only have one delegate that listens to all alerts at any given time. You could of course create a separate class for each alert view, but that’s a bit overkill. Instead, […]
How to fix "Use of undeclared identifier 'NSFoundationVersionNumber_iOS_6_1'" error in Xcode 5
This can happen when you try to run code built for iOS 7 Base SDK on Xcode 4.x, or if you compile against an older Base SDK in Xcode 5. The solution is to define what isn’t defined manually using a Macro. Add this to every class that’s complaining and you should be fine: #ifndef […]