<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss version="2.0">
    <channel>
        <title>Kodephp.org</title>
        <description>Learn PHP Programming by Examples</description>
        <link>
        http://www.kodephp.org</link>
        <copyright>This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported
            License.
        </copyright>
            <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/kodephprss" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="kodephprss" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
            <title>How to remove non ASCII characters from a string?</title>
            <link>
            http://www.kodephp.org/examples/56.html</link>
            <guid>http://www.kodephp.org/examples/56.html</guid>
            <description>&lt;p&gt;In the following code snippet you'll see how to remove non ASCII characters from a string. The &lt;code&gt;$str&lt;/code&gt; variable below contains some non ASCII characters. Becuase we don't want this characters to be there we'll remove it. We'll use a regular expression to do this using the &lt;code&gt;preg_replace()&lt;/code&gt; function.&lt;/p&gt;

&lt;p&gt;As you can see below the regex simply means that we what to remove the characters that doesn't belong in the range of &lt;code&gt;x20..x7E&lt;/code&gt; ASCII characters. But we also want to keep the linefeed &lt;code&gt;\n&lt;/code&gt; (&lt;code&gt;x0A&lt;/code&gt;) and the carriage return &lt;code&gt;\r&lt;/code&gt; (&lt;code&gt;x0D&lt;/code&gt;). You can learn more about ASCII code here: &lt;a href="http://www.asciitable.com/"&gt;ASCII Table&lt;/a&gt;.&lt;/p&gt;

&lt;div class="notranslate" style="overflow: auto; margin-bottom: 15px;"&gt;&lt;pre class="brush: java; gutter: true;" style="overflow: hidden;"&gt;
&amp;lt;?php
$str = 'Thïs ìs ä
string.';

//
// Replace characters where the ASCII code outside of x20..x7E.
//
$str = preg_replace('/[^\x0A\x0D\x20-\x7E]/', '', $str);

echo $str;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The code snippet will output these lines:&lt;/p&gt;

&lt;pre&gt;
Ths s 
string.
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
            <pubDate>2013-03-19 20:57:08</pubDate>
        </item>
            <item>
            <title>How do I remove some elements from array?</title>
            <link>
            http://www.kodephp.org/examples/55.html</link>
            <guid>http://www.kodephp.org/examples/55.html</guid>
            <description>&lt;p&gt;To remove some element from an array we can use the &lt;code&gt;array_splice()&lt;/code&gt; function. This function will take arguments such as the &lt;code&gt;input&lt;/code&gt; array, the &lt;code&gt;offset&lt;/code&gt; and the &lt;code&gt;length&lt;/code&gt;. This function will return the extracted elements from the input array. And the input array will be modified to not contain the removed elements.&lt;/p&gt;

&lt;p&gt;There are some rules to remember regarding the &lt;code&gt;offset&lt;/code&gt; and the &lt;code&gt;length&lt;/code&gt; parameter.&lt;/p&gt;

&lt;p&gt;
&lt;ul&gt;
&lt;li&gt;When the &lt;code&gt;offset&lt;/code&gt; is defined and have a positive value it will start from the beginning of the array.&lt;/li&gt;
&lt;li&gt;When the &lt;code&gt;offset&lt;/code&gt; have a negative value it will start from the end of the array.&lt;/li&gt;
&lt;li&gt;When the &lt;code&gt;length&lt;/code&gt; is defined and have a positive value it will have that many elements in the sequence.&lt;/li&gt;
&lt;li&gt;When the &lt;code&gt;length&lt;/code&gt; have a negative value it will stop that many elements from the end of the array.&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;

&lt;p&gt;Let see the code snippet below:

&lt;div class="notranslate" style="overflow: auto; margin-bottom: 15px;"&gt;&lt;pre class="brush: java; gutter: true;" style="overflow: hidden;"&gt;
&amp;lt;?php
$fruits = array('orange', 'apple', 'banana', 'mango', 'grape', 'lemon');
//
// Remove banana, mango, grape and lemon from the $fruits.
//
$result = array_splice($fruits, 2);
print 'Fruits: ' . implode(', ', $fruits) . "\n";
print 'Result: ' . implode(', ', $result) . "\n";


$fruits = array('orange', 'apple', 'banana', 'mango', 'grape', 'lemon');
//
// Remove banana and mango the $fruits.
//
$result = array_splice($fruits, 2, 2);
print 'Fruits: ' . implode(', ', $fruits) . "\n";
print 'Result: ' . implode(', ', $result) . "\n";


$fruits = array('orange', 'apple', 'banana', 'mango', 'grape', 'lemon');
//
// Remove apple, banana, mango and grape from the $fruits.
//
$result = array_splice($fruits, 1, -1);
print 'Fruits: ' . implode(', ', $fruits) . "\n";
print 'Result: ' . implode(', ', $result) . "\n";
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The result of the snippet:&lt;/p&gt;

&lt;pre&gt;
Fruits: orange, apple
Result: banana, mango, grape, lemon

Fruits: orange, apple, grape, lemon
Result: banana, mango

Fruits: orange, lemon
Result: apple, banana, mango, grape
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
            <pubDate>2012-12-18 20:10:54</pubDate>
        </item>
            <item>
            <title>How do I eliminate duplicate elements from array?</title>
            <link>
            http://www.kodephp.org/examples/54.html</link>
            <guid>http://www.kodephp.org/examples/54.html</guid>
            <description>&lt;p&gt;You want to eliminate duplicate elements from an array to create an array with a unique values. To do this you can use the &lt;code&gt;array_unique()&lt;/code&gt; function. This function takes in the array as an argument and will return you a new array with unique elements in it. Let see the snippet below:&lt;/p&gt;

&lt;div class="notranslate" style="overflow: auto; margin-bottom: 15px;"&gt;&lt;pre class="brush: java; gutter: true;" style="overflow: hidden;"&gt;
&amp;lt;?php
// The $color array that contains duplicate elements.
$colors = array(
    'red', 'green', 'blue', 'yellow', 'red', 'green', 'yellow'
);

// Eliminates the duplicate elements from the $colors array.
$uniqueColors = array_unique($colors);

print_r($uniqueColors);
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The result contain no duplicate elements.&lt;/p&gt;

&lt;pre&gt;
Array
(
    [0] =&gt; red
    [1] =&gt; green
    [2] =&gt; blue
    [3] =&gt; yellow
)
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
            <pubDate>2012-12-18 19:10:43</pubDate>
        </item>
            <item>
            <title>How do I print out an array variable?</title>
            <link>
            http://www.kodephp.org/examples/53.html</link>
            <guid>http://www.kodephp.org/examples/53.html</guid>
            <description>&lt;p&gt;The are many ways available to print out the elements of an array. You can print it out using a loop statement like &lt;code&gt;for&lt;/code&gt;, &lt;code&gt;foreach&lt;/code&gt; or &lt;code&gt;while&lt;/code&gt; loop. You can join the array into a single string separated by comma using the &lt;code&gt;implode()&lt;/code&gt; function as another way. Let see the snippet below:&lt;/p&gt;

&lt;div class="notranslate" style="overflow: auto; margin-bottom: 15px;"&gt;&lt;pre class="brush: java; gutter: true;" style="overflow: hidden;"&gt;
&amp;lt;?php
$myArray = array('a', 'b', 'c', 'd', 'e');

// Print out using for loop.
for ($i = 0; $i &amp;lt; count($myArray); $i++) {
    echo $myArray[$i];
}

echo "\n";

// Print out using foreach loop.
foreach (array_keys($myArray) as $key) {
    echo $myArray[$key];
}

echo "\n";

// Print out using while loop.
$index = 0;
while ($index &amp;lt; count($myArray)) {
    echo $myArray[$index];
    $index++;
}

echo "\n";

// Print out using implode(), convert array into string 
// separated each element using comma.
$str = implode(', ', $myArray);
echo $str;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The are also other functions that you can use the print the content of an array, or even an array of arrays. These functions can help you a lot when debugging your code. The function that we talked here is the &lt;code&gt;print_r()&lt;/code&gt; and &lt;code&gt;var_dump()&lt;/code&gt; function. Let see some examples below:&lt;/p&gt;

[code]

// Declares an array of arrays and print the elements using
// print_r() function.
$matrix = array(
    array(1, 2, 3),
    array(2, 3, 1),
    array(3, 1, 2)
);
print_r($matrix);

// Declare an associative array of user and print out using
// var_dump() function.
$user = array(
    'username' =&gt; 'admin',
    'password' =&gt; 's3cr3t',
    'fullName' =&gt; 'Foo Bar',
    'address'  =&gt; array(
        'street'  =&gt; 'Sunset Road',
        'city'    =&gt; 'Kuta',
        'zipcode' =&gt; '90000'
    )
);
var_dump($user);
[/code]

&lt;p&gt;The result of &lt;code&gt;print_r()&lt;/code&gt; followed by &lt;code&gt;var_dump()&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;
Array
(
    [0] =&gt; Array
        (
            [0] =&gt; 1
            [1] =&gt; 2
            [2] =&gt; 3
        )

    [1] =&gt; Array
        (
            [0] =&gt; 2
            [1] =&gt; 3
            [2] =&gt; 1
        )

    [2] =&gt; Array
        (
            [0] =&gt; 3
            [1] =&gt; 1
            [2] =&gt; 2
        )

)

array(4) {
  ["username"]=&gt;
  string(5) "admin"
  ["password"]=&gt;
  string(6) "s3cr3t"
  ["fullName"]=&gt;
  string(7) "Foo Bar"
  ["address"]=&gt;
  array(3) {
    ["street"]=&gt;
    string(11) "Sunset Road"
    ["city"]=&gt;
    string(4) "Kuta"
    ["zipcode"]=&gt;
    string(5) "90000"
  }
}
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
            <pubDate>2012-12-18 19:01:25</pubDate>
        </item>
            <item>
            <title>How do I declare array variables?</title>
            <link>
            http://www.kodephp.org/examples/52.html</link>
            <guid>http://www.kodephp.org/examples/52.html</guid>
            <description>&lt;p&gt;This example show you how to create an array variable in your PHP code. You can create array using the &lt;code&gt;[]&lt;/code&gt; operator and add items sequentially to your array. You can see this in the first lines of our code snippet below. Other than that you can use the &lt;code&gt;array()&lt;/code&gt; construct to declare an array.&lt;/p&gt;

&lt;div class="notranslate" style="overflow: auto; margin-bottom: 15px;"&gt;&lt;pre class="brush: java; gutter: true;" style="overflow: hidden;"&gt;
&amp;lt;?php
//
// Creates an array sequentially.
//
$text[] = 'The ';
$text[] = 'quick ';
$text[] = 'brown ';
$text[] = 'fox.';
print_r($text);

//
// The line below will give the equals array as the one
// created above.
//
$text = array('The ', 'quick ', 'brown ', 'fox.');
print_r($text);

//
// Print the array using for loop.
//
for ($i = 0; $i &amp;lt; count($text); $i++) {
    echo $text[$i];
}
echo "\n";
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In PHP we can also use the &lt;code&gt;array()&lt;/code&gt; construct to create an associative array. An associative array can have a collection of data in a &lt;code&gt;key&lt;/code&gt;-&lt;code&gt;value&lt;/code&gt; pairs. To iterate the array you can use the &lt;code&gt;for&lt;/code&gt; or &lt;code&gt;foreach&lt;/code&gt; loop statement.&lt;/p&gt;

[code]
&lt;?php
//
// Construct array with associative keys.
//
$text = array('A' =&gt; 'The ', 'B' =&gt; 'quick ', 'C' =&gt; 'brown ',
    'D' =&gt; 'fox.');
print_r($text);

//
// Print the array using foreach loop
//
$keys = array_keys($text);
foreach ($keys as $key) {
    echo $text[$key];
}
[/code]

&lt;p&gt;You can also create an array of arrays. Which basically an array that have another array as its elements. You can see how we construct an array of arrays in the following snippet.&lt;/p&gt; 

[code]
&lt;?php
//
// Construct array of arrays
//
$data = array(
    array(0, 0),
    array(0, 1),
    array(1, 0),
    array(1, 1),
);
print_r($data);
[/code]

&lt;p&gt;The code snippet result:&lt;/p&gt;

&lt;pre&gt;
Array
(
    [0] =&gt; The 
    [1] =&gt; quick 
    [2] =&gt; brown 
    [3] =&gt; fox.
)
Array
(
    [0] =&gt; The 
    [1] =&gt; quick 
    [2] =&gt; brown 
    [3] =&gt; fox.
)
The quick brown fox.
Array
(
    [A] =&gt; The 
    [B] =&gt; quick 
    [C] =&gt; brown 
    [D] =&gt; fox.
)
The quick brown fox.Array
(
    [0] =&gt; Array
        (
            [0] =&gt; 0
            [1] =&gt; 0
        )

    [1] =&gt; Array
        (
            [0] =&gt; 0
            [1] =&gt; 1
        )

    [2] =&gt; Array
        (
            [0] =&gt; 1
            [1] =&gt; 0
        )

    [3] =&gt; Array
        (
            [0] =&gt; 1
            [1] =&gt; 1
        )

)
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
            <pubDate>2012-12-18 02:20:46</pubDate>
        </item>
            <item>
            <title>How do I add or subtract date and time?</title>
            <link>
            http://www.kodephp.org/examples/51.html</link>
            <guid>http://www.kodephp.org/examples/51.html</guid>
            <description>&lt;p&gt;This example show you how to do date and time addition and subtraction in PHP. In the following snippet we will use the &lt;code&gt;strtotime()&lt;/code&gt; method. This method takes two arguments, &lt;code&gt;time&lt;/code&gt; the string to be parsed and &lt;code&gt;now&lt;/code&gt; the timestamp used a the base of calculation. If the &lt;code&gt;now&lt;/code&gt; argument is omitted this function will use the current timestamp as the base for the calculation.&lt;/p&gt;

&lt;div class="notranslate" style="overflow: auto; margin-bottom: 15px;"&gt;&lt;pre class="brush: java; gutter: true;" style="overflow: hidden;"&gt;
&amp;lt;?php
//
// Define the format of the date and time.
//
$format = "Y-m-d H:i:s";

//
// Get the current date plus 10 days.
//
$result = date($format, strtotime("+10 day"));
echo "Result: $result.\n";

//
// Get the current date plus 1 month.
//
$result = date($format, strtotime("1 month"));
echo "Result: $result.\n";

//
// Get the current date and time plus 1 day, 1 hour, 10 minutes
//
$result = date($format, strtotime("1 day 1 hour 10 minutes"));
echo "Result: $result.\n";

//
// Get the current date and time minus 1 week, 1 hour, 10 minutes
//
$result = date($format, strtotime("-1 week -1 hour -10 minutes"));
echo "Result: $result.\n";

//
// Add 3 months to the specified $date
//
$date = '2012-12-18';
$newDate = date('Y-m-d', strtotime('3 months', strtotime($date)));
echo "Date: $date; New Date: $newDate";
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The output of the code snippet:&lt;/p&gt;

&lt;pre&gt;
Result: 2012-12-28 09:24:15.
Result: 2013-01-18 09:24:15.
Result: 2012-12-19 10:34:15.
Result: 2012-12-11 08:14:15.
Date: 2012-12-18; New Date: 2013-03-18
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
            <pubDate>2012-12-18 01:28:38</pubDate>
        </item>
            <item>
            <title>How do I convert string into date in PHP?</title>
            <link>
            http://www.kodephp.org/examples/50.html</link>
            <guid>http://www.kodephp.org/examples/50.html</guid>
            <description>&lt;p&gt;To convert a string representation of a date information into date in PHP we can use the combination of &lt;code&gt;strtotime()&lt;/code&gt; and &lt;code&gt;date()&lt;/code&gt; functions. The first step is to convert the string into timestamp using the &lt;code&gt;strtotime()&lt;/code&gt; function. After having the timestamp we can pass it to the &lt;code&gt;date()&lt;/code&gt; function with the corresponding date format to get the date.&lt;/p&gt;

&lt;p&gt;Let's see the code snippet below:&lt;/p&gt;

&lt;div class="notranslate" style="overflow: auto; margin-bottom: 15px;"&gt;&lt;pre class="brush: java; gutter: true;" style="overflow: hidden;"&gt;
&amp;lt;?php
//
// A string of date.
//
$newYear = "01 January 2013";

//
// Convert a string of date into timestamp.
//
$timestamp = strtotime($newYear);

//
// Create a date from the timestamp and print out.
//
$date = date("Y-m-d", $timestamp);
echo "New Year: $date.\n";
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
            <pubDate>2012-12-12 02:15:26</pubDate>
        </item>
            <item>
            <title>How do I check whether a given date is valid?</title>
            <link>
            http://www.kodephp.org/examples/49.html</link>
            <guid>http://www.kodephp.org/examples/49.html</guid>
            <description>&lt;p&gt;To validate if a specified date represent a valid date we can use the &lt;code&gt;checkdate()&lt;/code&gt; function. This function requires three argument to be supplied, the &lt;code&gt;month&lt;/code&gt;, &lt;code&gt;day&lt;/code&gt; and &lt;code&gt;year&lt;/code&gt; value of the date to be validated. If it represent a valid date this function will return &lt;code&gt;true&lt;/code&gt; otherwise it will return &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;div class="notranslate" style="overflow: auto; margin-bottom: 15px;"&gt;&lt;pre class="brush: java; gutter: true;" style="overflow: hidden;"&gt;
&amp;lt;?php
/**
 * Validates whether the given month, date and year represent a valid
 * date value.
 *
 * @param int $month
 * @param int $day
 * @param int $year
 */
function validateDate($month, $day, $year) {
    if (checkdate($month, $day, $year)) {
        echo "\"$month/$day/$year\" is a valid date value.\n";
    } else {
        echo "\"$month/$day/$year\" is not a valid date value.\n";
    }
}

validateDate(2, 31, 2012);
validateDate(1, 1, 2013);
validateDate(31, 9, 2012);
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The output of the code snippet:&lt;/p&gt;

&lt;pre&gt;
"2/31/2012" is not a valid date value.
"1/1/2013" is a valid date value.
"31/9/2012" is not a valid date value.
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
            <pubDate>2012-12-12 01:59:35</pubDate>
        </item>
            <item>
            <title>How do I get current date and time as an array?</title>
            <link>
            http://www.kodephp.org/examples/48.html</link>
            <guid>http://www.kodephp.org/examples/48.html</guid>
            <description>&lt;p&gt;In the following code snippet you will learn how to get the current date and time as an array. To get the date as an array we can use the &lt;code&gt;getdate()&lt;/code&gt; function. This function will return an associative array that contains the date time information. The keys of the array for example &lt;code&gt;seconds&lt;/code&gt;, &lt;code&gt;minutes&lt;/code&gt;, &lt;code&gt;month&lt;/code&gt;, &lt;code&gt;year&lt;/code&gt; etc, as you can see in the code below.&lt;/p&gt;

&lt;p&gt;By default the &lt;code&gt;getdate()&lt;/code&gt; function will return the current timestamp. You need to pass the &lt;code&gt;timestamp&lt;/code&gt; into this function if you want to convert another date into an array.&lt;/p&gt;

&lt;div class="notranslate" style="overflow: auto; margin-bottom: 15px;"&gt;&lt;pre class="brush: java; gutter: true;" style="overflow: hidden;"&gt;
&amp;lt;?php
//
// Get current date as an array.
//
$dateArray = getdate();

//
// Read each element from the associative array.
//
echo 'seconds   = ' . $dateArray['seconds'] . "\n";
echo 'minutes   = ' . $dateArray['minutes'] . "\n";
echo 'hours     = ' . $dateArray['hours'] . "\n";
echo 'mday      = ' . $dateArray['mday'] . "\n";
echo 'wday      = ' . $dateArray['wday'] . "\n";
echo 'mon       = ' . $dateArray['mon'] . "\n";
echo 'year      = ' . $dateArray['year'] . "\n";
echo 'yday      = ' . $dateArray['yday'] . "\n";
echo 'weekday   = ' . $dateArray['weekday'] . "\n";
echo 'month     = ' . $dateArray['month'] . "\n";
echo 'timestamp = ' . $dateArray[0] . "\n\n";

//
// Or simply print out the $dateArray to see the contents
//
print_r($dateArray);
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;When you running the snippet you'll get the following output:&lt;/p&gt;

&lt;pre&gt;
seconds   = 16
minutes   = 34
hours     = 9
mday      = 12
wday      = 3
mon       = 12
year      = 2012
yday      = 346
weekday   = Wednesday
month     = December
timestamp = 1355301256

Array
(
    [seconds] =&gt; 16
    [minutes] =&gt; 34
    [hours] =&gt; 9
    [mday] =&gt; 12
    [wday] =&gt; 3
    [mon] =&gt; 12
    [year] =&gt; 2012
    [yday] =&gt; 346
    [weekday] =&gt; Wednesday
    [month] =&gt; December
    [0] =&gt; 1355301256
)
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
            <pubDate>2012-12-12 01:34:24</pubDate>
        </item>
            <item>
            <title>How do I get the current date and time?</title>
            <link>
            http://www.kodephp.org/examples/47.html</link>
            <guid>http://www.kodephp.org/examples/47.html</guid>
            <description>&lt;p&gt;To get the current date or today's date in PHP we can use the &lt;code&gt;date()&lt;/code&gt; function. This function has two arguments. The &lt;code&gt;format&lt;/code&gt; of the date and the &lt;code&gt;timestamp&lt;/code&gt;. To get the today's date all we need is the &lt;code&gt;format&lt;/code&gt; and it will use the default time as the &lt;code&gt;timestamp&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here is the code snippet:&lt;/p&gt;

&lt;div class="notranslate" style="overflow: auto; margin-bottom: 15px;"&gt;&lt;pre class="brush: java; gutter: true;" style="overflow: hidden;"&gt;
&amp;lt;?php
//
// Get the current date in year/month/day format.
//
$today = date("Y/m/d");
echo "Today: $today.\n";

//
// Get the current date as Wednesday, 12 Dec 2012.
//
$today = date("l, d M Y");
echo "Today: $today.\n";

//
// Get the current date as December 12, 2012.
//
$today = date("F d, Y");
echo "Today: $today.\n";

//
// Get the current date as 12/12/2012 08:21:28.
// date/month/year hour/minute/second.
//
$today = date("d/m/Y H:i:s");
echo "Today: $today.\n";
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The output of code snippet:&lt;/p&gt;

&lt;pre&gt;
Today: 2012/12/12.
Today: Wednesday, 12 Dec 2012.
Today: December 12, 2012.
Today: 12/12/2012 08:22:30.
&lt;/pre&gt;

&lt;p&gt;For more information about the date format you can find it in the date function documentation at the following address &lt;a href="http://php.net/manual/en/function.date.php"&gt;PHP: date - Manual&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
            <pubDate>2012-12-12 00:19:03</pubDate>
        </item>
        </channel>
</rss>
