Tutorialspoint

PHP timezone_abbreviations

php

<?php
   $res = timezone_abbreviations_list();
   print_r($res["act"]);
?>

PHP timezone_abbreviations_list() function

php

<?php
   $timezone_abbreviations = timezone_abbreviations_list (); 
   print_r($timezone_abbreviations["acst"]); 
   echo "----------------------------------------------\n"; 
   # Using second function. 
   $timezone_abbreviations = DateTimeZone::listAbbreviations(); 
   print_r($timezone_abbreviations["acst"]);
?>

PHP ctype_cntrl() function

php

<?php
   $arr = array('str1' =>"\n\r\t", 'str2' =>"demo76876test"); 
   foreach ($arr as $a => $demo) { 
      if (ctype_cntrl($demo)) { 
         echo "$a has all control characters. \n"; 
      }else { 
         echo "$a does not have all control characters. \n"; 
      } 
   }
?>   

PHP ctype_print() function

php

<?php
   $arr = array('asdf\n\r\t', 'yu67', "fooo#int%@");
   foreach ($arr as $x) {
      if (ctype_print($x)) {
         echo "$x has all printable characters. \n";
      }else {
         echo "$x does not have all printable characters. \n";
      }
   }
?>

PHP ctype_graph() function

php

<?php
   $arr = array('khy\n\r\t', 'arf12', 'LKA#@%.54');
   foreach ($arr as $demo) {
      if (ctype_graph($demo)) {
         echo "$demo consists of all (visibly) printable characters \n";
      }else {
         echo "$demo does not have all (visibly) printable characters. \n";
      }
   }
?>

PHP easter_days() function

php

<?php
   echo "Easter Day was ". easter_days(2017) . " days after March 21 in the year 2017";
?>

PHP key() function

php

<?php
   $arr = array("Electronics","Footwear");
   echo "Key from the current position = " . key($arr);
?>

PHP ksort() function

php

<?php
   $product = array("headphone"=>"10", "mouse"=>"24", "pendrive"=>"13");
   ksort($product);
   foreach ($product as $key => $val) {
      echo "$key = $val\n";
   }
?>

PHP asort() function

php

<?php
   $a = array(
      "0" => "India",
      "1" => "Australia",
      "2" => "England",
      "3" => "Bangladesh",
      "4" => "Zimbabwe",
   );
   asort($a);
   foreach ($a as $key => $val) {
      echo "[$key] = $val";
      echo"\n";
   }
?>

PHP shuffle() function

php

<?php
   $arr = array("mac", "windows", "linux", "solaris");
   shuffle($arr);
   print_r($arr);
?>

Previous 1 ... 3 4 5 6 7 8 9 ... 1813 Next
Advertisements
Loading...