SlideShare a Scribd company logo
Arrays                                                                                                                Regex
array_intersect                                                                                                               ereg
  array_merge                                                                                                                 eregi
     array_pop          ^                Start of string                   Y     4 digit year                2005             ereg_replace
    array_push          $                End of string                     y     2 digit year                05               eregi_replace
 array_reverse          .                                                  F                                                  split
                                         Any single character                    Long month                  January
    array_walk                                                                                                                spliti
          count         (a|b)            a or b                           M      Short month                 Jan              preg_match
       in_array         (...)            Group section                    m      Month (leading zeros)       01 to 12         preg_match_all
                        [abc]            Item in range (a or b or c)       n     Month                       1 to 12          preg_replace
Date and Time           [^abc]                                            D                                                   preg_split
                                         Not in range (not a or b or c)          Short day name              Mon
           date
        mktime          s               White space                       l     Long day name               Monday           Sessions
      strtotime         a?               Zero or one of a                  d     Day (leading zeros)         01 to 31         session_destroy
           time         a*               Zero or more of a                 j     Day                         1 to 31          session_id
                        a+               One or more of a                                                                     session_start
    Filesystem
 clearstatcache         a{3}             Exactly 3 of a                    h     12 Hour (leading zeros)     01 to 12         Strings
               copy     a{3,}            3 or more of a                    g     12 Hour                     1 to 12          addslashes
             fclose     a{3,6}           Between 3 and 6 of a             H      24 Hour (leading zeros)     00 to 23         crypt
              fgets                                                      G                                                   echo
                                         Escape character                        24 Hour                     0 to 23
                 file                                                                                                         explode
       filemtime                                                           i     Minutes (leading zeros)     00 to 59         implode
           filesize     [:punct:]        Any punctuation symbol            s     Seconds (leading zeros)     00 to 59         md5
      file_exists       [:space:]        Any space character                                                                  nl2br
             fopen      [:blank:]                                         w                                                   sprintf
                                         Space or tab                            Day of week    1
                                                                                                             0 to 6
              fread                                                                                                           strip_tags
             fwrite                                                        z     Day of year                 0 to 365         stripslashes
             is_dir                                                       W      Week of year       2
                                                                                                             1 to 53          stristr
            is_file                                                        t     Days in month               28 to 31         strpos
          readfile                                                                                                            strrev
                        i                Case-insensitive                                                                     strstr
      Headers           s                Period matches newline            a                                 am or pm         strtolower
        header          m                ^ and $ match lines              A                                  AM or PM         strtoupper
  headers_sent          U                Ungreedy matching                B      Swatch Internet Time        000 to 999       str_replace
     setcookie                                                            S                                                   substr
                        e                Evaluate replacement                    Ordinal Suffix              st, nd, td, th
                                                                                                                              trim
              Mail      x                Pattern over several lines
              mail                                                         T     Timezone of machine         GMT              URLs
                                                                          Z      Timezone offset (seconds)                    rawurldecode
    Numbers                                                               O                                                   rawurlencode
                                                                                 Difference to GMT (hours)   +0200
           ceil                                                                                                               urldecode
         floor                                                             I     Daylight savings            1 or 0           urlencode
                        array_push ( array, element )
number_format                                                              L     Leap year                   1 or 0
        round           in_array ( needle, haystack )                                                                         Variables
                        explode ( separator, string )                                                                         empty
                                                                          U      Seconds since Epoch    3

Miscellaneous           split ( pattern, string )                                                                             is_array
        define                                                             c     ISO 8601 (PHP 5)                             is_int
                        preg_split ( pattern, string )
          eval                                                             r     RFC 2822                                     is_null
          exit          ereg ( pattern, string )                                                                              is_numeric
                        strpos ( haystack, needle )                       1. date("w"): 0 is Sunday, 6 is Saturday.           is_object
       Network          str_replace ( search, replace, string )                                                               isset
      fsockopen                                                                                                               serialize
                                                                          2. Week that overlaps two years belongs to
                                                                                                                              unserialize
  PHP Options                                                                year that contains most days of that
         ini_get                                                               week. Hence week number for 1st January        SuperGlobals
    ini_restore                                                                of a given year can return 53rd week if        $_ENV
         ini_set        r                Read                                                                                 $_GET
                                                                               week belongs to previous year.
        phpinfo         r+               Read and write, prepend                                                              $_POST
                                                                               date("W", mktime(0, 0, 0, 12, 28, $year))      $_COOKIE
                        w                Write, truncate
     Execution                                                                 always gives correct number of weeks in        $_SESSION
                        w+               Read and write, truncate
          exec                                                                 $year.                                         $_SERVER
                        a                Write, append                                                                        $_FILES
                        a+               Read and write, append                                                               $_REQUEST
                                                                          3. The Epoch was the 1st January 1970.              $GLOBALS



                                                                                         Available free from www.ILoveJackDaniels.com

More Related Content

PDF
我的 DevOps 故事
PPTX
Software Engineering unit 2
PPTX
Top down and botttom up Parsing
PPTX
Golang - Overview of Go (golang) Language
PDF
実践 Git - 低レベルに知る Git
PDF
CI/CDツール比較してみた
PPT
Structural patterns
PPTX
Critical Section in Operating System
我的 DevOps 故事
Software Engineering unit 2
Top down and botttom up Parsing
Golang - Overview of Go (golang) Language
実践 Git - 低レベルに知る Git
CI/CDツール比較してみた
Structural patterns
Critical Section in Operating System

What's hot (20)

PDF
エンジニアのためのOSSライセンス管理~OSS管理ツールの池の水全部抜く~
PPT
Introduction to event driven programming
PPTX
Code generation
PDF
Parse Tree
PPTX
Real time operating systems (rtos) concepts 5
PDF
Continuous Integration/Deployment with Gitlab CI
PPT
PPTX
Error Detection & Recovery
PPT
Applet Architecture - Introducing Java Applets
PPT
5.state diagrams
 
PPTX
JRE , JDK and platform independent nature of JAVA
PPT
Lecture 04 syntax analysis
PDF
Scalaで型クラス入門
PPTX
Software requirement specification
PDF
世界でいちばんわかりやすいドメイン駆動設計
PPTX
Spring Boot ユーザの方のための Quarkus 入門
PPT
Introduction to Eclipse IDE
PPTX
Process management in operating system | process states | PCB | FORK() | Zomb...
PPT
Android lifecycle
PPTX
Core java
エンジニアのためのOSSライセンス管理~OSS管理ツールの池の水全部抜く~
Introduction to event driven programming
Code generation
Parse Tree
Real time operating systems (rtos) concepts 5
Continuous Integration/Deployment with Gitlab CI
Error Detection & Recovery
Applet Architecture - Introducing Java Applets
5.state diagrams
 
JRE , JDK and platform independent nature of JAVA
Lecture 04 syntax analysis
Scalaで型クラス入門
Software requirement specification
世界でいちばんわかりやすいドメイン駆動設計
Spring Boot ユーザの方のための Quarkus 入門
Introduction to Eclipse IDE
Process management in operating system | process states | PCB | FORK() | Zomb...
Android lifecycle
Core java
Ad

More from Piyush Mittal (20)

PPTX
Power mock
PDF
Design pattern tutorial
PPT
Reflection
PPTX
Gpu archi
PPTX
Cuda Architecture
PDF
Intel open mp
PDF
Intro to parallel computing
PDF
Cuda toolkit reference manual
PDF
Matrix multiplication using CUDA
PPT
Channel coding
PPT
Basics of Coding Theory
PDF
Java cheat sheet
PDF
Google app engine cheat sheet
PDF
Git cheat sheet
PDF
Vi cheat sheet
PDF
Css cheat sheet
PDF
Cpp cheat sheet
PDF
Ubuntu cheat sheet
PDF
oracle 9i cheat sheet
PDF
Open ssh cheet sheat
Power mock
Design pattern tutorial
Reflection
Gpu archi
Cuda Architecture
Intel open mp
Intro to parallel computing
Cuda toolkit reference manual
Matrix multiplication using CUDA
Channel coding
Basics of Coding Theory
Java cheat sheet
Google app engine cheat sheet
Git cheat sheet
Vi cheat sheet
Css cheat sheet
Cpp cheat sheet
Ubuntu cheat sheet
oracle 9i cheat sheet
Open ssh cheet sheat
Ad

Recently uploaded (20)

PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
master seminar digital applications in india
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Lesson notes of climatology university.
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Yogi Goddess Pres Conference Studio Updates
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
master seminar digital applications in india
Final Presentation General Medicine 03-08-2024.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Lesson notes of climatology university.
O5-L3 Freight Transport Ops (International) V1.pdf
Yogi Goddess Pres Conference Studio Updates
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Computing-Curriculum for Schools in Ghana
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Cell Types and Its function , kingdom of life
Module 4: Burden of Disease Tutorial Slides S2 2025
STATICS OF THE RIGID BODIES Hibbelers.pdf
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
202450812 BayCHI UCSC-SV 20250812 v17.pptx

Php cheat sheet

  • 1. Arrays Regex array_intersect ereg array_merge eregi array_pop ^ Start of string Y 4 digit year 2005 ereg_replace array_push $ End of string y 2 digit year 05 eregi_replace array_reverse . F split Any single character Long month January array_walk spliti count (a|b) a or b M Short month Jan preg_match in_array (...) Group section m Month (leading zeros) 01 to 12 preg_match_all [abc] Item in range (a or b or c) n Month 1 to 12 preg_replace Date and Time [^abc] D preg_split Not in range (not a or b or c) Short day name Mon date mktime s White space l Long day name Monday Sessions strtotime a? Zero or one of a d Day (leading zeros) 01 to 31 session_destroy time a* Zero or more of a j Day 1 to 31 session_id a+ One or more of a session_start Filesystem clearstatcache a{3} Exactly 3 of a h 12 Hour (leading zeros) 01 to 12 Strings copy a{3,} 3 or more of a g 12 Hour 1 to 12 addslashes fclose a{3,6} Between 3 and 6 of a H 24 Hour (leading zeros) 00 to 23 crypt fgets G echo Escape character 24 Hour 0 to 23 file explode filemtime i Minutes (leading zeros) 00 to 59 implode filesize [:punct:] Any punctuation symbol s Seconds (leading zeros) 00 to 59 md5 file_exists [:space:] Any space character nl2br fopen [:blank:] w sprintf Space or tab Day of week 1 0 to 6 fread strip_tags fwrite z Day of year 0 to 365 stripslashes is_dir W Week of year 2 1 to 53 stristr is_file t Days in month 28 to 31 strpos readfile strrev i Case-insensitive strstr Headers s Period matches newline a am or pm strtolower header m ^ and $ match lines A AM or PM strtoupper headers_sent U Ungreedy matching B Swatch Internet Time 000 to 999 str_replace setcookie S substr e Evaluate replacement Ordinal Suffix st, nd, td, th trim Mail x Pattern over several lines mail T Timezone of machine GMT URLs Z Timezone offset (seconds) rawurldecode Numbers O rawurlencode Difference to GMT (hours) +0200 ceil urldecode floor I Daylight savings 1 or 0 urlencode array_push ( array, element ) number_format L Leap year 1 or 0 round in_array ( needle, haystack ) Variables explode ( separator, string ) empty U Seconds since Epoch 3 Miscellaneous split ( pattern, string ) is_array define c ISO 8601 (PHP 5) is_int preg_split ( pattern, string ) eval r RFC 2822 is_null exit ereg ( pattern, string ) is_numeric strpos ( haystack, needle ) 1. date("w"): 0 is Sunday, 6 is Saturday. is_object Network str_replace ( search, replace, string ) isset fsockopen serialize 2. Week that overlaps two years belongs to unserialize PHP Options year that contains most days of that ini_get week. Hence week number for 1st January SuperGlobals ini_restore of a given year can return 53rd week if $_ENV ini_set r Read $_GET week belongs to previous year. phpinfo r+ Read and write, prepend $_POST date("W", mktime(0, 0, 0, 12, 28, $year)) $_COOKIE w Write, truncate Execution always gives correct number of weeks in $_SESSION w+ Read and write, truncate exec $year. $_SERVER a Write, append $_FILES a+ Read and write, append $_REQUEST 3. The Epoch was the 1st January 1970. $GLOBALS Available free from www.ILoveJackDaniels.com