We can add number of of days, months, years, hours and seconds with a DateTime object.
Example
$date = new DateTime(‘2007-05-05’);
$date->add(new DateInterval(‘P5Y’));
echo $date->format(‘Y-m-d’) . “n”;
?>
Output
2012-05-05
We can add number of of days, months, years, hours and seconds with a DateTime object.
Example
Output
2012-05-05
Example
<?php
$date = new DateTime(“24-May-2011 20:15:22”);
echo $date->format(“d-m-Y H:i:s”).'<br />’;
date_add($date, new DateInterval(“P1Y”));
echo ‘<br />’.$date->format(“d-m-Y”).’ : I Year’;
?>
Output
24-05-2011 20:15:22
24-05-2012 : I Year
It checks whether the date is valid or not
General Format :checkdate ( int $month , int $day , int $year )
Example :
<?php
if(checkdate(12, 31, 2000))
echo “Given Date Is Correct”;
?>
Output
Given Date Is Correct
<?php echo rand(1, 10) ?>
<?php
$id= JRequest::getVar(‘id’);
$objTitle = $article->load($id);
echo $objTitle->get(‘title’);
?>
<?php echo JRequest::getVar(‘id’); ?>
Magento is an e-commerce platform created on open source technology, which provides online merchants with an exceptional flexibility and control over the content, look and functionality of their e-commerce store.
Magento is an open-source content management system for e-commerce web sites. The software was originally developed by Varien Inc., a US private company headquartered in Culver City, California, with assistance from volunteers.
Varien published the first general-availability release of the software on March 31, 2008, under the name Bento. Roy Rubin, former CEO of Varien, later sold a substantial share of the company to eBay, which is now the sole owner.
According to research conducted by aheadWorks in October 2014, Magento’s market share among the 30 most popular e-commerce platforms is about 30%.
Magento employs the MySQL relational database management system, the PHP programming language, and elements of the Zend Framework. It applies the conventions of object-oriented programming and model-view-controller architecture. Magento also uses the entity–attribute–value model to store data.
We can find out the position using the function strpos() that will return the position of a character
Example
<?php
$string=”phpcodez.com”;
echo strpos($string,”.”) // 8
?>
Its a flag and if its value is set to one we must use the longer version of the variable
| Array Name | Longer version of the name |
| $_POST | $HTTP_POST_VARS |
| $_FILES | $HTTP_POST_FILES |
| $_GET | $HTTP_GET_VARS |
| $_COOKIE | $HTTP_COOKIE_VARS |
| $_ENV | $HTTP_ENV_VARS |
| $_SERVER | $HTTP_SERVER_VARS |
| $_SESSION | $HTTP_SESSION_VARS |
Its not at all a convenient option , so its always better to have the value set to off