<?php
$my_string = "This STRING has UPPERCASE letters";
$my_string = strtolower($my_string);
echo $my_string;
//Output: this string has uppercase letters
?>
Get Free Sinhala IT Learning Videos Kuppiya.com
<?php
$my_string = "This STRING has UPPERCASE letters";
$my_string = strtolower($my_string);
echo $my_string;
//Output: this string has uppercase letters
?>
<?php
//checkdate($month, $day, $year) - format
$month = 10;
$day = 12;
$year = 2008;
echo 'Valid Date Example: ';
if(checkdate($month, $day, $year))
{
echo 'Date is correct';
}
else
{
echo 'Date is incorrect';
}
echo '<br /><br />';
echo 'Invalid Date Example: ';
//Invalid date
$month = 14; // month is wrong
$day = 12;
$year = 2008;
if(checkdate($month, $day, $year))
{
echo 'Date is correct';
}
else
{
echo 'Date is incorrect';
}
?>
<?php
$array_items = array('item1', 'item2', 'item3');
$string_with_comma = implode(",", $array_items);
echo $string_with_comma; // item1,item2,item13
?>
<?php
$array = array(0 => 'Tom', 1 => 'Kusal', 2 => 'Jerry', 3 => 'Jhonny');
$key = array_search('Tom', $array);
echo $key; // $key = 0;
/* sample
$key = array_search('Kusal', $array); // $key = 1;
$key = array_search('Jerry', $array); // $key = 2;
$key = array_search('Jhonny', $array); // $key = 3;
sample */
?>
<?php
$names = array("Bill", "Kusal", "Rex", "Jhon");
if(in_array("Kusal", $names))
{
echo "Kusal is here";
}
else
{
echo 'Not Found';
}
?>
<?php
echo 'Original Date/Time <br />';
//mktime(hour,minute,second,month,day,year)
echo date("h:i:s d-m-Y", mktime(10, 15, 20, 8, 20, 2008));
//10:15:20 20-08-2008
echo '<br /><br />';
echo 'Date/Time Added by 1';
echo '<br />';
echo date("h:i:s d-m-Y", mktime(10+1, 15+1, 20+1, 8+1, 20+1,2008+1));
//11:16:21 21-09-2009
?>
<div onmouseover="this.style.background='green';"
onmouseout="this.style.background='white';">
kuppiya.com
</div>