SlideShare a Scribd company logo
PHP Day 3  Geshan Manandhar Developer,  Young Innovations Pvt. Limited www.geshanmanandhar.com http://www.php.net
PHP Strings A string is series of characters.  In PHP, a character is the same as a byte, which is exactly 256 different characters possible. <?php $s=“I am a string”; $s2=‘I am also a string”; print $s.”---”.$s2; ?>
PHP Strings Another Example <?php $beer = 'Heineken'; echo &quot;<br>$beer's taste is great.&quot;;  // works, &quot;'&quot; is an invalid character for varnames echo &quot;<br>He drank some $beers.&quot;;  // won't work, 's' is a valid character for varnames echo &quot;<br>He drank some ${beer}s.&quot;; // works echo &quot;<br>He drank some {$beer}s.&quot;; // works ?>
Important String Functions explode  (string $delimiter, string $string) nl2br  ( string $string ) strcmp  ( string $str1, string $str2 ) strlen  ( string $string ) strtolower  ( string $str ) substr  ( string $string, int $start [, int $length] ) trim  ( string $str ) Example code at  day03\prog22_string_functions.php
Array In computer science an array is a data structure consisting of a group of elements that are accessed by indexing.  In most programming languages each element has the same data type and the array occupies a contiguous area of storage.  Most programming languages have a built-in array data type.
Array ?php $fruits_1 = array (&quot;Apple&quot;, &quot;Mango&quot;, &quot;Banana&quot;); $fruits_2 = array ( 0 => &quot;Appple&quot;, 1 => &quot;Mango&quot;, 2 => &quot;Banana&quot; ); $fruits_3[] = &quot;Apple&quot;; $fruits_3[] = &quot;Mango&quot;; $fruits_3[] = &quot;Banana&quot;; ?> //Program code: day03\prog23_array_more.php
Multi-Dimensional Array <?php $shop = array( array( Title => &quot;rose&quot;,    Price => 1.25,     Number => 15      ),     array( Title => &quot;daisy&quot;,    Price => 0.75,   Number => 25,     ),   array( Title => &quot;orchid&quot;,      Price => 1.15,     Number => 7    )   ); ?> //full code at day03\prog24_array_multi.php
Important Array Function: asort asort($array) – Sort an array and maintain index association  <?php $fruits = array (&quot;d&quot; => &quot;lemon&quot;, &quot;a&quot; => &quot;orange&quot;, &quot;b&quot; => &quot;banana&quot;, &quot;c&quot; => &quot;apple&quot;); asort($fruits); foreach ($fruits as $key => $val) { echo &quot;$key = $val\n&quot;; } ?>
Important Array Function: push/pop array_push($array, element1,…) <?php $stack = array(&quot;orange&quot;, &quot;banana&quot;); array_push($stack, &quot;apple&quot;, &quot;raspberry&quot;); print_r($stack); ?> array_pop($array) <?php $stack = array(&quot;orange&quot;, &quot;banana&quot;, &quot;apple&quot;, &quot;raspberry&quot;); $fruit = array_pop($stack); print_r($stack); ?>
Important Array Function: search array_search($array, “item1”, “item2”…); <?php $array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red'); $key = array_search('green', $array); // $key = 2; $key = array_search('red', $array);   // $key = 1; ?>
Important Array Function : rand array_random ($array, no_of_entries); <?php $sentence = &quot;Pick one or more random entries out of an array&quot;; $input = explode(&quot; &quot;,$sentence); $rand_keys = array_rand($input, 2); echo $input[$rand_keys[0]] . &quot;\n&quot;; echo &quot;<br>&quot;; echo $input[$rand_keys[1]] . &quot;\n&quot;; ?>
Important Array Function : reverse array_reverse($array) <?php $input  = array(&quot;php&quot;, 4.0, &quot;green&quot;, &quot;red&quot;); $result = array_reverse($input); $result_keyed = array_reverse($input, true); ?>
Important Array Function : merge array_merge($array1, $array2…); <?php $array1 = array(&quot;color&quot; => &quot;red&quot;, 2, 4); $array2 = array(&quot;a&quot;, &quot;b&quot;, &quot;color&quot; => &quot;green&quot;, &quot;shape&quot; => &quot;trapezoid&quot;, 4); $result = array_merge($array1, $array2); print_r($result); ?>
Important Array Function: keys array_keys($array, param) <?php $array = array(0 => 100, &quot;color&quot; => &quot;red&quot;); print_r(array_keys($array)); $array = array(&quot;blue&quot;, &quot;red&quot;, &quot;green&quot;, &quot;blue&quot;, &quot;blue&quot;); print_r(array_keys($array, &quot;blue&quot;)); ?>
Date in php Code   Description d   Day of the month with leading zeros D  Day of the week as a three-letter abbreviation F  Name of the month h  Hour from 01to 12 H  Hour from 00 to 23 g  Hour from  1 to 12(no leading zeroes) G  Hour from 0 to 23(no leading zeroes) i  Minutes j  Day of the month with no leading zeroes l  Day of the week m  Month number from 01 to 12 M  Abbreviated month name (Jan, Feb…) n  Month number from 1 to 23(no leading zeroes) s  Seconds 00 to 59 S  Ordinal suffix for day of the month (1st, 2nd, 3rd) y  Year as two digits Y  Year as four digits z  Day of the year from 0 to 365
Some Date examples <?php // Assuming today is: March 10th, 2008, 5:16:18 pm $today = date(&quot;F j, Y, g:i a&quot;); // March 10, 2008, 5:16 pm $today = date(&quot;m.d.y&quot;); // 03.10.08 $today = date(&quot;j, n, Y&quot;); // 10, 3, 2008 $today = date(&quot;Ymd&quot;);  // 20080310 $today = date('h-i-s, j-m-y, it is w Day z ');  $today = date('\i\t \i\s \t\h\e jS \d\a\y.');   // It is the 10th day. $today = date(&quot;D M j G:i:s T Y&quot;); $today = date('H:m:s \m \i\s\ \m\o\n\t\h');  $today = date(&quot;H:i:s&quot;); // 17:16:17 ?>
Important Debugging Functions print_r Prints human-readable information about a variable  var_dump Dumps information about a variable  die() or exit() Dumps information about a variable
The more you dig in the more you find out Find out other built in functions in PHP yourself. Search at  www.php.net  for more.
Questions Put forward your queries.
Lets get rolling Print today’s date like Today is: December 18, 2008 and time is 12:10:10 PM. Reverse this sentence $str= “PHP learn to want I “ into a meaningful sentence, with use of array_reverse. “ Learning PHP is not that easy and not that difficult” – print it in lower and upper case with its string length.

More Related Content

PPT
Php array
Core Lee
 
PPT
Php Using Arrays
mussawir20
 
PPT
Arrays in PHP
Compare Infobase Limited
 
PDF
Php array
Nikul Shah
 
PPT
Class 4 - PHP Arrays
Ahmed Swilam
 
PPTX
Array in php
ilakkiya
 
PDF
Arrays in PHP
Vineet Kumar Saini
 
PDF
4.1 PHP Arrays
Jalpesh Vasa
 
Php array
Core Lee
 
Php Using Arrays
mussawir20
 
Php array
Nikul Shah
 
Class 4 - PHP Arrays
Ahmed Swilam
 
Array in php
ilakkiya
 
Arrays in PHP
Vineet Kumar Saini
 
4.1 PHP Arrays
Jalpesh Vasa
 

What's hot (18)

PPTX
PHP Functions & Arrays
Henry Osborne
 
PPTX
Chap 3php array part1
monikadeshmane
 
PPTX
PHP array 1
Mudasir Syed
 
PDF
PHP Unit 4 arrays
Kumar
 
PDF
Sorting arrays in PHP
Vineet Kumar Saini
 
PDF
DBIx::Class introduction - 2010
leo lapworth
 
PPTX
Marcs (bio)perl course
BITS
 
PDF
DBIx::Class beginners
leo lapworth
 
PDF
Working with text, Regular expressions
Krasimir Berov (Красимир Беров)
 
ODP
Introduction to Perl
Dave Cross
 
PDF
Scripting3
Nao Dara
 
ODP
Intermediate Perl
Dave Cross
 
PDF
Climbing the Abstract Syntax Tree (php[world] 2019)
James Titcumb
 
PPT
LPW: Beginners Perl
Dave Cross
 
KEY
Introduction to Perl Best Practices
José Castro
 
PHP Functions & Arrays
Henry Osborne
 
Chap 3php array part1
monikadeshmane
 
PHP array 1
Mudasir Syed
 
PHP Unit 4 arrays
Kumar
 
Sorting arrays in PHP
Vineet Kumar Saini
 
DBIx::Class introduction - 2010
leo lapworth
 
Marcs (bio)perl course
BITS
 
DBIx::Class beginners
leo lapworth
 
Working with text, Regular expressions
Krasimir Berov (Красимир Беров)
 
Introduction to Perl
Dave Cross
 
Scripting3
Nao Dara
 
Intermediate Perl
Dave Cross
 
Climbing the Abstract Syntax Tree (php[world] 2019)
James Titcumb
 
LPW: Beginners Perl
Dave Cross
 
Introduction to Perl Best Practices
José Castro
 
Ad

Viewers also liked (6)

PDF
PHP Basic & Arrays
M.Zalmai Rahmani
 
PPTX
Array in php
Ashok Kumar
 
ODP
My self learn -Php
laavanyaD2009
 
PDF
Web app development_php_06
Hassen Poreya
 
PPTX
Php string function
Ravi Bhadauria
 
PHP Basic & Arrays
M.Zalmai Rahmani
 
Array in php
Ashok Kumar
 
My self learn -Php
laavanyaD2009
 
Web app development_php_06
Hassen Poreya
 
Php string function
Ravi Bhadauria
 
Ad

Similar to 03 Php Array String Functions (20)

PDF
Php tips-and-tricks4128
PrinceGuru MS
 
PPTX
Php functions
JIGAR MAKHIJA
 
PDF
PHP tips and tricks
Damien Seguy
 
PPTX
UNIT IV (4).pptx
DrDhivyaaCRAssistant
 
PPTX
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Dhivyaa C.R
 
PPT
Arrays in php
Laiby Thomas
 
PPT
PHP-04-Arrays.ppt
Leandro660423
 
ODP
Php Learning show
Gnugroup India
 
PPT
PHP and MySQL with snapshots
richambra
 
PPT
P H P Part I, By Kian
phelios
 
PPTX
Chapter 2 wbp.pptx
40NehaPagariya
 
PDF
lab4_php
tutorialsruby
 
PDF
lab4_php
tutorialsruby
 
PDF
How to run PHP code in XAMPP.docx (1).pdf
rajeswaria21
 
PPSX
DIWE - Advanced PHP Concepts
Rasan Samarasinghe
 
PPTX
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
ZahouAmel1
 
PPT
arrays.ppt
SchoolEducationDepar
 
Php tips-and-tricks4128
PrinceGuru MS
 
Php functions
JIGAR MAKHIJA
 
PHP tips and tricks
Damien Seguy
 
UNIT IV (4).pptx
DrDhivyaaCRAssistant
 
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Dhivyaa C.R
 
Arrays in php
Laiby Thomas
 
PHP-04-Arrays.ppt
Leandro660423
 
Php Learning show
Gnugroup India
 
PHP and MySQL with snapshots
richambra
 
P H P Part I, By Kian
phelios
 
Chapter 2 wbp.pptx
40NehaPagariya
 
lab4_php
tutorialsruby
 
lab4_php
tutorialsruby
 
How to run PHP code in XAMPP.docx (1).pdf
rajeswaria21
 
DIWE - Advanced PHP Concepts
Rasan Samarasinghe
 
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
ZahouAmel1
 

More from Geshan Manandhar (20)

PDF
How to build an image to geo location guesser using Gemini 2 - Canberra.pdf
Geshan Manandhar
 
PDF
build-with-ai-sydney AI for web devs Tamas Piros
Geshan Manandhar
 
PDF
Are logs a software engineer’s best friend? Yes -- follow these best practices
Geshan Manandhar
 
PDF
We lost $ 20.5K in one day and how we could have saved it… hint: better autom...
Geshan Manandhar
 
PDF
Moving from A and B to 150 microservices, the journey, and learnings
Geshan Manandhar
 
PDF
Adopt a painless continuous delivery culture, add more business value
Geshan Manandhar
 
PDF
Things i wished i knew as a junior developer
Geshan Manandhar
 
PDF
Embrace chatops, stop installing deployment software - Laracon EU 2016
Geshan Manandhar
 
PDF
Do You Git Your Code? Follow Simplified Gitflow Branching Model to Improve Pr...
Geshan Manandhar
 
PDF
Embrace chatOps, stop installing deployment software
Geshan Manandhar
 
PDF
7 rules of simple and maintainable code
Geshan Manandhar
 
PDF
Software engineering In Nepal mid 2015 part 01
Geshan Manandhar
 
PDF
A simplified Gitflow
Geshan Manandhar
 
PDF
How to become a better software company technically
Geshan Manandhar
 
PDF
Things I wished I knew while doing my tech bachelor / undergraduate
Geshan Manandhar
 
PDF
Message Queues a basic overview
Geshan Manandhar
 
PDF
Most popular brands, people on facebook in nepal as of 2013 q4
Geshan Manandhar
 
PDF
Drupal 7 basic setup and contrib modules for a brochure website
Geshan Manandhar
 
PPTX
Git intro hands on windows with msysgit
Geshan Manandhar
 
ODP
Drupal 7 install with modules and themes
Geshan Manandhar
 
How to build an image to geo location guesser using Gemini 2 - Canberra.pdf
Geshan Manandhar
 
build-with-ai-sydney AI for web devs Tamas Piros
Geshan Manandhar
 
Are logs a software engineer’s best friend? Yes -- follow these best practices
Geshan Manandhar
 
We lost $ 20.5K in one day and how we could have saved it… hint: better autom...
Geshan Manandhar
 
Moving from A and B to 150 microservices, the journey, and learnings
Geshan Manandhar
 
Adopt a painless continuous delivery culture, add more business value
Geshan Manandhar
 
Things i wished i knew as a junior developer
Geshan Manandhar
 
Embrace chatops, stop installing deployment software - Laracon EU 2016
Geshan Manandhar
 
Do You Git Your Code? Follow Simplified Gitflow Branching Model to Improve Pr...
Geshan Manandhar
 
Embrace chatOps, stop installing deployment software
Geshan Manandhar
 
7 rules of simple and maintainable code
Geshan Manandhar
 
Software engineering In Nepal mid 2015 part 01
Geshan Manandhar
 
A simplified Gitflow
Geshan Manandhar
 
How to become a better software company technically
Geshan Manandhar
 
Things I wished I knew while doing my tech bachelor / undergraduate
Geshan Manandhar
 
Message Queues a basic overview
Geshan Manandhar
 
Most popular brands, people on facebook in nepal as of 2013 q4
Geshan Manandhar
 
Drupal 7 basic setup and contrib modules for a brochure website
Geshan Manandhar
 
Git intro hands on windows with msysgit
Geshan Manandhar
 
Drupal 7 install with modules and themes
Geshan Manandhar
 

Recently uploaded (20)

PDF
NewMind AI Monthly Chronicles - July 2025
NewMind AI
 
PDF
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
SMACT Works
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Software Development Company | KodekX
KodekX
 
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
georgschmitzdoerner
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PPTX
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
PDF
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
Shreyas_Phanse_Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
SHREYAS PHANSE
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
DOCX
Top AI API Alternatives to OpenAI: A Side-by-Side Breakdown
vilush
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
DevOps & Developer Experience Summer BBQ
AUGNYC
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
PDF
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
CIFDAQ
 
NewMind AI Monthly Chronicles - July 2025
NewMind AI
 
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
SMACT Works
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Software Development Company | KodekX
KodekX
 
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
madgavkar20181017ppt McKinsey Presentation.pdf
georgschmitzdoerner
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
Shreyas_Phanse_Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
SHREYAS PHANSE
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Top AI API Alternatives to OpenAI: A Side-by-Side Breakdown
vilush
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
DevOps & Developer Experience Summer BBQ
AUGNYC
 
This slide provides an overview Technology
mineshkharadi333
 
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
CIFDAQ
 

03 Php Array String Functions

  • 1. PHP Day 3 Geshan Manandhar Developer, Young Innovations Pvt. Limited www.geshanmanandhar.com http://www.php.net
  • 2. PHP Strings A string is series of characters. In PHP, a character is the same as a byte, which is exactly 256 different characters possible. <?php $s=“I am a string”; $s2=‘I am also a string”; print $s.”---”.$s2; ?>
  • 3. PHP Strings Another Example <?php $beer = 'Heineken'; echo &quot;<br>$beer's taste is great.&quot;; // works, &quot;'&quot; is an invalid character for varnames echo &quot;<br>He drank some $beers.&quot;; // won't work, 's' is a valid character for varnames echo &quot;<br>He drank some ${beer}s.&quot;; // works echo &quot;<br>He drank some {$beer}s.&quot;; // works ?>
  • 4. Important String Functions explode (string $delimiter, string $string) nl2br ( string $string ) strcmp ( string $str1, string $str2 ) strlen ( string $string ) strtolower ( string $str ) substr ( string $string, int $start [, int $length] ) trim ( string $str ) Example code at day03\prog22_string_functions.php
  • 5. Array In computer science an array is a data structure consisting of a group of elements that are accessed by indexing. In most programming languages each element has the same data type and the array occupies a contiguous area of storage. Most programming languages have a built-in array data type.
  • 6. Array ?php $fruits_1 = array (&quot;Apple&quot;, &quot;Mango&quot;, &quot;Banana&quot;); $fruits_2 = array ( 0 => &quot;Appple&quot;, 1 => &quot;Mango&quot;, 2 => &quot;Banana&quot; ); $fruits_3[] = &quot;Apple&quot;; $fruits_3[] = &quot;Mango&quot;; $fruits_3[] = &quot;Banana&quot;; ?> //Program code: day03\prog23_array_more.php
  • 7. Multi-Dimensional Array <?php $shop = array( array( Title => &quot;rose&quot;, Price => 1.25, Number => 15 ), array( Title => &quot;daisy&quot;, Price => 0.75, Number => 25, ), array( Title => &quot;orchid&quot;, Price => 1.15, Number => 7 ) ); ?> //full code at day03\prog24_array_multi.php
  • 8. Important Array Function: asort asort($array) – Sort an array and maintain index association <?php $fruits = array (&quot;d&quot; => &quot;lemon&quot;, &quot;a&quot; => &quot;orange&quot;, &quot;b&quot; => &quot;banana&quot;, &quot;c&quot; => &quot;apple&quot;); asort($fruits); foreach ($fruits as $key => $val) { echo &quot;$key = $val\n&quot;; } ?>
  • 9. Important Array Function: push/pop array_push($array, element1,…) <?php $stack = array(&quot;orange&quot;, &quot;banana&quot;); array_push($stack, &quot;apple&quot;, &quot;raspberry&quot;); print_r($stack); ?> array_pop($array) <?php $stack = array(&quot;orange&quot;, &quot;banana&quot;, &quot;apple&quot;, &quot;raspberry&quot;); $fruit = array_pop($stack); print_r($stack); ?>
  • 10. Important Array Function: search array_search($array, “item1”, “item2”…); <?php $array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red'); $key = array_search('green', $array); // $key = 2; $key = array_search('red', $array);   // $key = 1; ?>
  • 11. Important Array Function : rand array_random ($array, no_of_entries); <?php $sentence = &quot;Pick one or more random entries out of an array&quot;; $input = explode(&quot; &quot;,$sentence); $rand_keys = array_rand($input, 2); echo $input[$rand_keys[0]] . &quot;\n&quot;; echo &quot;<br>&quot;; echo $input[$rand_keys[1]] . &quot;\n&quot;; ?>
  • 12. Important Array Function : reverse array_reverse($array) <?php $input = array(&quot;php&quot;, 4.0, &quot;green&quot;, &quot;red&quot;); $result = array_reverse($input); $result_keyed = array_reverse($input, true); ?>
  • 13. Important Array Function : merge array_merge($array1, $array2…); <?php $array1 = array(&quot;color&quot; => &quot;red&quot;, 2, 4); $array2 = array(&quot;a&quot;, &quot;b&quot;, &quot;color&quot; => &quot;green&quot;, &quot;shape&quot; => &quot;trapezoid&quot;, 4); $result = array_merge($array1, $array2); print_r($result); ?>
  • 14. Important Array Function: keys array_keys($array, param) <?php $array = array(0 => 100, &quot;color&quot; => &quot;red&quot;); print_r(array_keys($array)); $array = array(&quot;blue&quot;, &quot;red&quot;, &quot;green&quot;, &quot;blue&quot;, &quot;blue&quot;); print_r(array_keys($array, &quot;blue&quot;)); ?>
  • 15. Date in php Code Description d Day of the month with leading zeros D Day of the week as a three-letter abbreviation F Name of the month h Hour from 01to 12 H Hour from 00 to 23 g Hour from 1 to 12(no leading zeroes) G Hour from 0 to 23(no leading zeroes) i Minutes j Day of the month with no leading zeroes l Day of the week m Month number from 01 to 12 M Abbreviated month name (Jan, Feb…) n Month number from 1 to 23(no leading zeroes) s Seconds 00 to 59 S Ordinal suffix for day of the month (1st, 2nd, 3rd) y Year as two digits Y Year as four digits z Day of the year from 0 to 365
  • 16. Some Date examples <?php // Assuming today is: March 10th, 2008, 5:16:18 pm $today = date(&quot;F j, Y, g:i a&quot;); // March 10, 2008, 5:16 pm $today = date(&quot;m.d.y&quot;); // 03.10.08 $today = date(&quot;j, n, Y&quot;); // 10, 3, 2008 $today = date(&quot;Ymd&quot;);  // 20080310 $today = date('h-i-s, j-m-y, it is w Day z ');  $today = date('\i\t \i\s \t\h\e jS \d\a\y.');   // It is the 10th day. $today = date(&quot;D M j G:i:s T Y&quot;); $today = date('H:m:s \m \i\s\ \m\o\n\t\h'); $today = date(&quot;H:i:s&quot;); // 17:16:17 ?>
  • 17. Important Debugging Functions print_r Prints human-readable information about a variable var_dump Dumps information about a variable die() or exit() Dumps information about a variable
  • 18. The more you dig in the more you find out Find out other built in functions in PHP yourself. Search at www.php.net for more.
  • 19. Questions Put forward your queries.
  • 20. Lets get rolling Print today’s date like Today is: December 18, 2008 and time is 12:10:10 PM. Reverse this sentence $str= “PHP learn to want I “ into a meaningful sentence, with use of array_reverse. “ Learning PHP is not that easy and not that difficult” – print it in lower and upper case with its string length.