SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
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

Más contenido relacionado

Más de Piyush Mittal

Más de Piyush Mittal (20)

Power mock
Power mockPower mock
Power mock
 
Design pattern tutorial
Design pattern tutorialDesign pattern tutorial
Design pattern tutorial
 
Reflection
ReflectionReflection
Reflection
 
Gpu archi
Gpu archiGpu archi
Gpu archi
 
Cuda Architecture
Cuda ArchitectureCuda Architecture
Cuda Architecture
 
Intel open mp
Intel open mpIntel open mp
Intel open mp
 
Intro to parallel computing
Intro to parallel computingIntro to parallel computing
Intro to parallel computing
 
Cuda toolkit reference manual
Cuda toolkit reference manualCuda toolkit reference manual
Cuda toolkit reference manual
 
Matrix multiplication using CUDA
Matrix multiplication using CUDAMatrix multiplication using CUDA
Matrix multiplication using CUDA
 
Channel coding
Channel codingChannel coding
Channel coding
 
Basics of Coding Theory
Basics of Coding TheoryBasics of Coding Theory
Basics of Coding Theory
 
Java cheat sheet
Java cheat sheetJava cheat sheet
Java cheat sheet
 
Google app engine cheat sheet
Google app engine cheat sheetGoogle app engine cheat sheet
Google app engine cheat sheet
 
Git cheat sheet
Git cheat sheetGit cheat sheet
Git cheat sheet
 
Vi cheat sheet
Vi cheat sheetVi cheat sheet
Vi cheat sheet
 
Css cheat sheet
Css cheat sheetCss cheat sheet
Css cheat sheet
 
Cpp cheat sheet
Cpp cheat sheetCpp cheat sheet
Cpp cheat sheet
 
Ubuntu cheat sheet
Ubuntu cheat sheetUbuntu cheat sheet
Ubuntu cheat sheet
 
oracle 9i cheat sheet
oracle 9i cheat sheetoracle 9i cheat sheet
oracle 9i cheat sheet
 
Open ssh cheet sheat
Open ssh cheet sheatOpen ssh cheet sheat
Open ssh cheet sheat
 

Último

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 

Último (20)

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 

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