Posts

public void setName(String name) { this.name = name; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getPassword2() { return password2; } public void setPassword2(String password2) { this.password2 = password2; }

php format date string short month

As you can see in our last example there are tons of different formats that can be used in the date feature. Below is a summary of the variable used in date, and what each does. Remember they ARE CaSe sEnsItIVe: DAYS   d - day of the month 2 digits (01-31)   j - day of the month (1-31)   D - 3 letter day (Mon - Sun)   l - full name of day (Monday - Sunday)   N - 1=Monday, 2=Tuesday, etc (1-7)   S - suffix for date (st, nd, rd)   w - 0=Sunday, 1=Monday (0-6)   z - day of the year (1=365) WEEK   W - week of the year (1-52) MONTH   F - Full name of month (January - December) m - 2 digit month number (01-12)   n - month number (1-12)   M - 3 letter month (Jan - Dec)   t - Days in the month (28-31) YEAR L - leap year (0 no, 1 yes) o - ISO-8601 year number (Ex. 1979, 2006) Y - four digit year (Ex. 1979, 2006) y - two digit year (Ex. 79, 06) TIME a - am or pm A - AM or PM B - Swatch Internet time (000 - 999) g - 12 hour (1-12) G - 24 hour c (0-23) h - 2 digi

Attempting to understand handling regular expressions with php

Regular Expression, commonly known as RegEx is considered to be one of the most complex concepts. However, this is not really true. Unless you have worked with regular expressions before, when you look at a regular expression containing a sequence of special characters like /, $, ^, \, ?, *, etc., in combination with alphanumeric characters, you might think it a mess. RegEx is a kind of language and if you have learnt its symbols and understood their meaning, you would find it as the most useful tool in hand to solve many complex problems related to text searches. Just consider how you would make a search for files on your computer. You most likely use the ? and * characters to help find the files you're looking for. The ? character matches a single character in a file name, while the * matches zero or more characters. A pattern such as 'file?.txt' would find the following files: file1.txt filer.txt files.txt Using the * character inst

Regular expression handler quicker learn in php

Regex quick reference [abc]     A single character: a, b or c [^abc]     Any single character but a, b, or c [a-z]     Any single character in the range a-z [a-zA-Z]     Any single character in the range a-z or A-Z ^     Start of line $     End of line \A     Start of string \z     End of string .     Any single character \s     Any whitespace character \S     Any non-whitespace character \d     Any digit \D     Any non-digit \w     Any word character (letter, number, underscore) \W     Any non-word character \b     Any word boundary character (...)     Capture everything enclosed (a|b)     a or b a?     Zero or one of a a*     Zero or more of a a+     One or more of a a{3}     Exactly 3 of a a{3,}     3 or more of a a{3,6}     Between 3 and 6 of a PCRE Patterns preg_match_all() - Perform a global regular expression match preg_replace() - Perform a regular expression search and replace preg_split() - Split string by a regular expression preg_last_error() - Returns the error cod

php email reader and notification though header parameters

down vote accepted For the reading confirmations: You have to add the X-Confirm-Reading-To header. X - Confirm - Reading - To : <address> For delivery confirmations: You have to add the Disposition-Notification-To header.

Authorize.net ARB class Automated recurring billing class

<?php class AuthnetARBException extends Exception {} class WP_Invoice_AuthnetARB { private $login; private $transkey; private $params = array(); private $sucess = false; private $error = true; var $xml; var $response; private $resultCode; private $code; private $text; private $subscrId; public function __construct() { $this->url = stripslashes(get_option("wp_invoice_recurring_gateway_url")); $this->login = stripslashes(get_option("wp_invoice_gateway_username")); $this->transkey = stripslashes(get_option("wp_invoice_gateway_tran_key")); } private function process($retries = 3) { $count = 0; while ($count < $retries) { $ch = curl_init(); //required for GoDaddy if(get_option('wp_invoice_using_godaddy') == 'yes') { curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); curl_setopt ($ch, CUR

php image upload class file

<?php     class Uploader     {         private $destinationPath;         private $errorMessage;         private $extensions;         private $allowAll;         private $maxSize;         private $uploadName;         private $seqnence;         public $name='Uploader';         public $useTable    =false;         function setDir($path){             $this->destinationPath  =   $path;             $this->allowAll =   false;         }         function allowAllFormats(){             $this->allowAll =   true;         }         function setMaxSize($sizeMB){             $this->maxSize  =   $sizeMB * (1024*1024);         }         function setExtensions($options){             $this->extensions   =   $options;         }         function setSameFileName(){             $this->sameFileName =   true;             $this->sameName =   true;         }         function getExtension($string){             $ext    =   "";             try{                     $parts  =