iPhone 4 does not want to switch on

Woke up one morning and my iPhone 4 was dead, I tried holding in the power button, charged the phone and nothing happened, did not even make a sound or showed the apple logo. Although the previous night the battery was still 77% charged, but the phone just was dead, luckily I managed to get it on again Answer: Hold the Power Button and the Home Button together for between 15 and 30 seconds, you notice the Apple logo will appear and the iPhone 4 will switch on. If the iPhone4 keeps on going off, try the above solution again and then Go to Settings->Reset->Reset All Settings (NOTE: This will reset all your settings to factory defaults, but won’t delete any data, I suggest before doing anything you are unsure about backup your iPhone 4) The last thing to try before going to the Apple Store is to do a Factory Restore from ITunes

March 22, 2018 · 1 min · 154 words · icarnaghan

Nusoap - PHP Warning: Attempt to modify property of non-object in nusoap/lib/nusoap.php on line 4603

Open the file lib/nusoap.php and change line 4594 from $this->schemas[$ns]->imports[$ns2][$ii]['loaded'] = true; to $this->schemas[$ns][$ns2]->imports[$ns2][$ii]['loaded'] = true; Source: http://sourceforge.net/projects/nusoap/forums/forum/193578/topic/4566878

March 22, 2018 · 1 min · 18 words · icarnaghan

PHP function to get the number of days between two dates

The below function can be used to calculate the difference in days between two dates USAGE: /** * Getting the number of days between two dates * * @param string $date1 yyyy-mm-dd * @param string $date2 yyyy-mm-dd * @return integer */ function getDiffInDays($date1,$date2){ $datediff = strtotime($date1)- strtotime($date2); return floor($datediff/(60*60*24)); } $days = getDiffInDays('2013-02-15','2013-01-26');

March 22, 2018 · 1 min · 53 words · icarnaghan

PHP function used to read CSV files

The below function can be used to read CSV files and returning an array with all values obtained from the CSV file USAGE: Copy the below function to your PHP script function readCSV($csvFile){ $file_handle = fopen($csvFile, 'r'); while (!feof($file_handle) ) { $line_of_text[] = fgetcsv($file_handle, 1024); }

March 22, 2018 · 1 min · 46 words · icarnaghan

PHP Script that deletes files within a remote directory via FTP older than a given amount of days

The following PHP script lets you connect to a remote location via PHP’s FTP functionality and delete all files older than a certain amount of given days in that directory, it also provides functionality to list files that should be ignored in a array, these files listed in the array won’t be deleted even if they are older than the given days. This script can be used together with a cron job, to automate a process. For example if you have a directory where you store automated backups via FTP and don’t have the time to delete old backups, this script can help to automate the process given that you only have FTP access to the directory ...

March 22, 2018 · 2 min · 361 words · icarnaghan

Removing Dotted Outline Around Active Link using CSS

When a link on a webpage becomes Active sometimes a Dotted Outline appears which might look ugly in certain circumstances.The CSS outline property should be used to remove or style the Dotted Outline. If you want to remove this Dotted Outline from every active link on the webpage simply add the following code: a { outline: 0; }

March 22, 2018 · 1 min · 58 words · icarnaghan

Script to resize PNG, JPG and GIF images using PHP keeping the aspect ratio

How this script works: What this script does, it resizes any PNG, JPG or GIF image to the given width and height and stores the image to a specified location. If the width is set to 0 it will automatically calculate the width by using the height given by keeping the aspect ratio the same is. The same goes for when the height is set to 0 and the width is given. ...

March 22, 2018 · 2 min · 264 words · icarnaghan

What is the difference between public, private and protected keywords?

Public - Are variables that are visible to all classes Private -Are variables that are visible only to the class they belong Protected - Are variable that are visible to the class they belong and to the subclasses of the class they belong

March 22, 2018 · 1 min · 43 words · icarnaghan

What is the purpose of the & Ampersand in front of PHP Variables

What this does it creates a reference to the original variable and thus does not copy the value of the original variable. $original_var = 500; &$ref_var = $original_var; //This will print the value 500 echo $ref_var; //Now we change the value of the original variable to 600 $original_var = 600; //Now we print the value of the reference variable, and the reference variable takes the value of the original variable echo $ref_var; //This will print 600 ...

March 22, 2018 · 1 min · 100 words · icarnaghan

What is the purpose of the pre html tag?

The text displayed within a pre element is displayed in a fixed width and a default font. Spaces and line breaks are both displayed as typed. So text that you typed within a pre tag will be displayed exactly how you typed it. Example: This is a test within a pre html Tag The above will ouput: This is a test within a pre html Tag ...

March 22, 2018 · 1 min · 87 words · icarnaghan