if (preg_match('/^(http|https)://([A-Z0-9][A-Z0-9_-]*(?:.[A-Z0-9][A-Z0-9_-]*)+):?(d+)?/?/i', $url)) {
echo "Your url is ok.";
} else {
echo "Wrong url.";
}
Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts
Thursday, August 1, 2013
Sunday, May 5, 2013
In php5, If a class has both __construct() and class name as function, which will be called while creating objects ?
Answer: Only __construct() will be called.
Try out example
Try out example
<?php
class myClass
{
function myClass()
{
echo "In class name";
}
function __construct()
{
echo "In __construct";
}
}
$obj = new myClass();
?>
Output: In __construct
Subscribe to:
Posts (Atom)