Backup is one of the most important things that has to be done in your environment. But doing manual backup every week is hard work. You have to log in to your cPanel, navigate to the backup page or backup wizard page, make your selection and click the button. Why can’t we automate this process? If you have standard cPanel (not a customised like Hostgator), you can set an automated backup with the help of cron job, PHP and FTP …
Category: PHP Snippets
Sometimes I need to know where a function is called from. Especially when a function is called a lot by other functions. This piece of one liner will help you to determine where the function was called from. [crayon-676e9a75ee963357811006/] You can echo it as well. [crayon-676e9a75ee96d542487807/]
I have an issue with iOS Photo recently not being displayed properly after uploading. After googling around, I’ve managed to found a workaround for this issue. Imagine this scenario: You have a working website with file uploader and then strange phenomenon happens when you upload a photo from iPhone in portrait. The photo is uploaded properly, but the orientation is landscape. What is the problem with iOS Photo? The problem was that image rotation was added to the photo as EXIF …
There are some times when I need to check some variables or run a full error reporting but I don’t want to let anyone see what’s going on. So a quick solution is to allow my code to run what I want for specific IP Address (which is my IP Address) [crayon-676e9a75eec82513283356/] This PHP snippet is handy if you need to do print_r(), var_dump(), or even test a block of code. Don’t forget to change the IP address to your …