Programming Archives - Ian Carnaghan

How to clear all breakpoints in a Visual Studio Solution

Click on Debug -> Delete All Breakpoints or press the shortcut key combination Ctrl+Shift+F9

Sep 2 · 3 sec read >

You are not authorized to access when trying to connect to TFS account in Visual Studio 2015

To solve this problem you have to clean the cache folder on your machine. Press Win + R together to open...

Sep 2 · 13 sec read >

The Visual Studio component cache is out of date. Please restart Visual Studio. (mscorlib) – Microsoft SQL Server Management Studio

To fix the error message open the Disk Cleanup utility in Windows. Tick the Temporary files tick box and click on OK. Select Delete Files...

Sep 2 · 8 sec read >

How to embed images using PHPMailer

Use the AddEmbeddedImage method provided by the PHPMailer class.  eg. $mail->AddEmbeddedImage(‘test.gif’,’testImage’,’test.gif’); Parameters for AddEmbeddedImage($path, $cid, $name = ”, $encoding = ‘base64’, $type = ‘application/octet-stream’) $path = Path...

Sep 2 · 29 sec read >

Comparison Operators

PHP comparison operators allows you to compare two values with each other. Below is a table of all the...

Mar 22 · 37 sec read >

How to subtract a number of days from todays date using PHP date function

$var = ‘2007-08-15’; $var_subtracted_date = date(‘Y-m-d’, strtotime(‘-2 days’, strtotime($var))); Explanation of PHP functions: 1) FUNCTION date DESCRIPTION string date ( string $format  ) PARAMETERS USED IN THIS EXAMPLE...

Mar 22 · 30 sec read >

How to print the contents of an array using PHP

//Array example $arr = array(‘one’,’two’,’three’,’four’); Use the print_r function. Example: print_r($arr); The example above will print out the following: Array ( ...

Mar 22 · 19 sec read >

How to get the Nameservers of a domain using PHP

Use the  dns_get_record function with type DNS_NS Example: //Add this piece of code to your PHP will $result = dns_get_record(‘yourdomain.com‘,DNS_NS); Execute the script...

Mar 22 · 19 sec read >

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...

Mar 22 · 21 sec read >