SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
Array Functions                                    Regular Expression Functions                     Date Formatting

array_diff (arr1, arr2 ...)                        ereg (pattern, str)                              Y    4 digit year (2008)
array_filter (arr, function)                       split (pattern, str)                             y    2 digit year (08)
array_flip (arr)                                   ereg_replace (pattern, replace, str)             F    Long month (January)
array_intersect (arr1, arr2 ...)                   preg_grep (pattern, arr)                         M    Short month (Jan)
array_merge (arr1, arr2 ...)                       preg_match (pattern, str)                        m    Month     4
                                                                                                                       (01 to 12)
array_pop (arr)                                    preg_match_all (pattern, str, arr)               n    Month (1 to 12)
array_push (arr, var1, var2 ...)                   preg_replace (pattern, replace, str)             D    Short day name (Mon)
array_reverse (arr)                                preg_split (pattern, str)                        l    Long day name (Monday) (lowercase L)
array_search (needle, arr)                                                                          d    Day   4
                                                                                                                   (01 to 31)
array_walk (arr, function)                                                                          j    Day (1 to 31)
                                                  Regular Expressions Syntax
count (count)
in_array (needle, haystack)                        ^                 Start of string                h    12 Hour       4
                                                                                                                           (01 to 12)
                                                   $                 End of string                  g    12 Hour (1 to 12)
                                                   .                 Any single character           H    24 Hour       4
                                                                                                                           (00 to 23)
String Functions
                                                   (a|b)             a or b                         G    24 Hour (0 to 23)
crypt (str, salt)                                  (...)             Group section                  i    Minutes       4
                                                                                                                           (00 to 59)
explode (sep, str)                                 [abc]             Item in range (a, b or c)      s    Seconds       4
                                                                                                                           (00 to 59)
implode (glue, arr)                                [^abc]            Not in range (not a, b or c)
nl2br (str)                                        s                White space                    w    Day of week          1
                                                                                                                                  (0 to 6)
sprintf (frmt, args)                               a?                Zero or one of a               z    Day of year (0 to 365)
strip_tags (str, allowed_tags)                     a*                Zero or more of a              W    Week of year             2
                                                                                                                                      (1 to 53)
str_replace (search, replace, str)                 a*?               Zero or more of a, ungreedy    t    Days in month (28 to 31)
strpos (str, needle)                               a+                One or more of a
strrev (str)                                       a+?               One or more of a, ungreedy     a    am or pm
strstr (str, needle)                               a{3}              Exactly 3 of a                 A    AM or PM
strtolower (str)                                   a{3,}             3 or more of a                 B    Swatch Internet Time (000 to 999)
strtoupper (str)                                   a{,6}             Up to 6 of a                   S    Ordinal Suffix (st, nd, rd, th)
substr (string, start, len)                        a{3,6}            3 to 6 of a
                                                   a{3,6}?           3 to 6 of a, ungreedy          T    Timezone of machine (GMT)
                                                                    Escape character               Z    Timezone offset (seconds)
Filesystem Functions
                                                   [:punct:]         Any punctuation symbol         O    Difference to GMT (hours) (e.g., +0200)
clearstatcache ()                                  [:space:]         Any space character            I    Daylight saving (1 or 0)
copy (source, dest)                                [:blank:]         Space or tab                   L    Leap year (1 or 0)
fclose (handle)
fgets (handle, len)                                                                                 U    Seconds since Epoch                3
                                                   PCRE Modifiers
file (file)                                                                                         c    ISO 8601 (PHP 5)
filemtime (file)                                   i                 Case-insensitive                    2008-07-31T18:30:13+01:00
filesize (file)                                    s                 Period matches newline         r    RFC 2822
file_exists (file)                                 m                 ^ and $ match lines                 Thu, 31 Jul 2008 18:30:13 +0100
fopen (file, mode)                                 U                 Ungreedy matching
fread (handle, len)                                e                 Evaluate replacement           1.   0 is Sunday, 6 is Saturday.
fwrite (handle, str)                               x                 Pattern over several lines
readfile (file)                                                                                     2.   Week that overlaps two years belongs
                                                                                                         to year that contains most days of that
                                                  Date and Time Functions
                                                                                                         week. Hence week number for 1st
fopen() Modes
                                                   checkdate (month, day, year)                          January of a given year can be 53 if
r                    Read                          date (format, timestamp)                              week belongs to previous year.
r+                   Read and write, prepend       getdate (timestamp)                                   date("W", mktime(0, 0, 0, 12, 8,
w                    Write, truncate               mktime (hr, min, sec, month, day, yr)                 $year)) always gives correct number of
w+                   Read and write, truncate      strftime (formatstring, timestamp)                    weeks in $year.
a                    Write, append                 strtotime (str)
a+                   Read and write, append        time ()                                          3.   The Epoch is the 1st January 1970.


                                Available free from AddedBytes.com                                  4.   With leading zeroes

Más contenido relacionado

La actualidad más candente

Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
Ehtisham Ali
 
Parameterized curves in r^3
Parameterized curves in r^3Parameterized curves in r^3
Parameterized curves in r^3
Tarun Gehlot
 
lecture 4
lecture 4lecture 4
lecture 4
sajinsc
 
Consistency proof of a feasible arithmetic inside a bounded arithmetic
Consistency proof of a feasible arithmetic inside a bounded arithmeticConsistency proof of a feasible arithmetic inside a bounded arithmetic
Consistency proof of a feasible arithmetic inside a bounded arithmetic
Yamagata Yoriyuki
 
Note on Character Theory-summer 2013
Note on Character Theory-summer 2013Note on Character Theory-summer 2013
Note on Character Theory-summer 2013
Fan Huang (Wright)
 

La actualidad más candente (20)

Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Basics & asymptotic notations
Basics & asymptotic notationsBasics & asymptotic notations
Basics & asymptotic notations
 
Parameterized curves in r^3
Parameterized curves in r^3Parameterized curves in r^3
Parameterized curves in r^3
 
Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...
Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...
Building Machine Learning Algorithms on Apache Spark: Scaling Out and Up with...
 
lecture 4
lecture 4lecture 4
lecture 4
 
Lista exercintegrais
Lista exercintegraisLista exercintegrais
Lista exercintegrais
 
Fourier Series for Continuous Time & Discrete Time Signals
Fourier Series for Continuous Time & Discrete Time SignalsFourier Series for Continuous Time & Discrete Time Signals
Fourier Series for Continuous Time & Discrete Time Signals
 
Ps02 cmth03 unit 1
Ps02 cmth03 unit 1Ps02 cmth03 unit 1
Ps02 cmth03 unit 1
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
big_oh
big_ohbig_oh
big_oh
 
Consistency proof of a feasible arithmetic inside a bounded arithmetic
Consistency proof of a feasible arithmetic inside a bounded arithmeticConsistency proof of a feasible arithmetic inside a bounded arithmetic
Consistency proof of a feasible arithmetic inside a bounded arithmetic
 
Lec12
Lec12Lec12
Lec12
 
Consistency proof of a feasible arithmetic inside a bounded arithmetic
Consistency proof of a feasible arithmetic inside a bounded arithmeticConsistency proof of a feasible arithmetic inside a bounded arithmetic
Consistency proof of a feasible arithmetic inside a bounded arithmetic
 
Mvtword
MvtwordMvtword
Mvtword
 
Remark on variance swaps pricing
Remark on variance swaps pricingRemark on variance swaps pricing
Remark on variance swaps pricing
 
Notes 17
Notes 17Notes 17
Notes 17
 
Note on Character Theory-summer 2013
Note on Character Theory-summer 2013Note on Character Theory-summer 2013
Note on Character Theory-summer 2013
 
Properties of Fourier transform
Properties of Fourier transformProperties of Fourier transform
Properties of Fourier transform
 
Consistency proof of a feasible arithmetic inside a bounded arithmetic
Consistency proof of a feasible arithmetic inside a bounded arithmeticConsistency proof of a feasible arithmetic inside a bounded arithmetic
Consistency proof of a feasible arithmetic inside a bounded arithmetic
 

Destacado (6)

E learning excel vba programming lesson 4
E learning excel vba programming  lesson 4E learning excel vba programming  lesson 4
E learning excel vba programming lesson 4
 
How to Design a Better BI and Analytics Experience for Everyone
How to Design a Better BI and Analytics Experience for EveryoneHow to Design a Better BI and Analytics Experience for Everyone
How to Design a Better BI and Analytics Experience for Everyone
 
DV Analytics and SAS Training in Bangalore
DV Analytics and SAS Training in BangaloreDV Analytics and SAS Training in Bangalore
DV Analytics and SAS Training in Bangalore
 
Dv Analytics Course Contents
Dv Analytics Course Contents Dv Analytics Course Contents
Dv Analytics Course Contents
 
Excel vba
Excel vbaExcel vba
Excel vba
 
Using Vba Excel
Using Vba ExcelUsing Vba Excel
Using Vba Excel
 

Similar a PHP Cheatsheet

python-cheat-sheet-v1
python-cheat-sheet-v1python-cheat-sheet-v1
python-cheat-sheet-v1
Hiroshi Ono
 
Assignment 2 interview preparation work COSC1285
Assignment 2 interview preparation work COSC1285Assignment 2 interview preparation work COSC1285
Assignment 2 interview preparation work COSC1285
MadelineLong2
 
Hybrid Atlas Models of Financial Equity Market
Hybrid Atlas Models of Financial Equity MarketHybrid Atlas Models of Financial Equity Market
Hybrid Atlas Models of Financial Equity Market
tomoyukiichiba
 
Unit3 jwfiles
Unit3 jwfilesUnit3 jwfiles
Unit3 jwfiles
mrecedu
 
5 parametric equations, tangents and curve lengths in polar coordinates
5 parametric equations, tangents and curve lengths in polar coordinates5 parametric equations, tangents and curve lengths in polar coordinates
5 parametric equations, tangents and curve lengths in polar coordinates
math267
 

Similar a PHP Cheatsheet (20)

Php cheat sheet
Php cheat sheetPhp cheat sheet
Php cheat sheet
 
python-cheat-sheet-v1
python-cheat-sheet-v1python-cheat-sheet-v1
python-cheat-sheet-v1
 
PHP Cheat Sheet
PHP Cheat SheetPHP Cheat Sheet
PHP Cheat Sheet
 
Assignment 2 interview preparation work COSC1285
Assignment 2 interview preparation work COSC1285Assignment 2 interview preparation work COSC1285
Assignment 2 interview preparation work COSC1285
 
Regexps
RegexpsRegexps
Regexps
 
Expresiones Regulares
Expresiones RegularesExpresiones Regulares
Expresiones Regulares
 
Suffix arrays
Suffix arraysSuffix arrays
Suffix arrays
 
ANSI C REFERENCE CARD
ANSI C REFERENCE CARDANSI C REFERENCE CARD
ANSI C REFERENCE CARD
 
Strings part2
Strings part2Strings part2
Strings part2
 
Text Mining using Regular Expressions
Text Mining using Regular ExpressionsText Mining using Regular Expressions
Text Mining using Regular Expressions
 
Hybrid Atlas Models of Financial Equity Market
Hybrid Atlas Models of Financial Equity MarketHybrid Atlas Models of Financial Equity Market
Hybrid Atlas Models of Financial Equity Market
 
Module-2_Strings concepts in c programming
Module-2_Strings concepts in c programmingModule-2_Strings concepts in c programming
Module-2_Strings concepts in c programming
 
Research Inventy : International Journal of Engineering and Science
Research Inventy : International Journal of Engineering and ScienceResearch Inventy : International Journal of Engineering and Science
Research Inventy : International Journal of Engineering and Science
 
STRING LIST TUPLE DICTIONARY FILE.pdf
STRING LIST TUPLE DICTIONARY FILE.pdfSTRING LIST TUPLE DICTIONARY FILE.pdf
STRING LIST TUPLE DICTIONARY FILE.pdf
 
C Language Unit-3
C Language Unit-3C Language Unit-3
C Language Unit-3
 
Unit3 jwfiles
Unit3 jwfilesUnit3 jwfiles
Unit3 jwfiles
 
2 homework
2 homework2 homework
2 homework
 
Python lecture 05
Python lecture 05Python lecture 05
Python lecture 05
 
The Ring programming language version 1.3 book - Part 26 of 88
The Ring programming language version 1.3 book - Part 26 of 88The Ring programming language version 1.3 book - Part 26 of 88
The Ring programming language version 1.3 book - Part 26 of 88
 
5 parametric equations, tangents and curve lengths in polar coordinates
5 parametric equations, tangents and curve lengths in polar coordinates5 parametric equations, tangents and curve lengths in polar coordinates
5 parametric equations, tangents and curve lengths in polar coordinates
 

Último

Último (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

PHP Cheatsheet

  • 1. Array Functions Regular Expression Functions Date Formatting array_diff (arr1, arr2 ...) ereg (pattern, str) Y 4 digit year (2008) array_filter (arr, function) split (pattern, str) y 2 digit year (08) array_flip (arr) ereg_replace (pattern, replace, str) F Long month (January) array_intersect (arr1, arr2 ...) preg_grep (pattern, arr) M Short month (Jan) array_merge (arr1, arr2 ...) preg_match (pattern, str) m Month 4 (01 to 12) array_pop (arr) preg_match_all (pattern, str, arr) n Month (1 to 12) array_push (arr, var1, var2 ...) preg_replace (pattern, replace, str) D Short day name (Mon) array_reverse (arr) preg_split (pattern, str) l Long day name (Monday) (lowercase L) array_search (needle, arr) d Day 4 (01 to 31) array_walk (arr, function) j Day (1 to 31) Regular Expressions Syntax count (count) in_array (needle, haystack) ^ Start of string h 12 Hour 4 (01 to 12) $ End of string g 12 Hour (1 to 12) . Any single character H 24 Hour 4 (00 to 23) String Functions (a|b) a or b G 24 Hour (0 to 23) crypt (str, salt) (...) Group section i Minutes 4 (00 to 59) explode (sep, str) [abc] Item in range (a, b or c) s Seconds 4 (00 to 59) implode (glue, arr) [^abc] Not in range (not a, b or c) nl2br (str) s White space w Day of week 1 (0 to 6) sprintf (frmt, args) a? Zero or one of a z Day of year (0 to 365) strip_tags (str, allowed_tags) a* Zero or more of a W Week of year 2 (1 to 53) str_replace (search, replace, str) a*? Zero or more of a, ungreedy t Days in month (28 to 31) strpos (str, needle) a+ One or more of a strrev (str) a+? One or more of a, ungreedy a am or pm strstr (str, needle) a{3} Exactly 3 of a A AM or PM strtolower (str) a{3,} 3 or more of a B Swatch Internet Time (000 to 999) strtoupper (str) a{,6} Up to 6 of a S Ordinal Suffix (st, nd, rd, th) substr (string, start, len) a{3,6} 3 to 6 of a a{3,6}? 3 to 6 of a, ungreedy T Timezone of machine (GMT) Escape character Z Timezone offset (seconds) Filesystem Functions [:punct:] Any punctuation symbol O Difference to GMT (hours) (e.g., +0200) clearstatcache () [:space:] Any space character I Daylight saving (1 or 0) copy (source, dest) [:blank:] Space or tab L Leap year (1 or 0) fclose (handle) fgets (handle, len) U Seconds since Epoch 3 PCRE Modifiers file (file) c ISO 8601 (PHP 5) filemtime (file) i Case-insensitive 2008-07-31T18:30:13+01:00 filesize (file) s Period matches newline r RFC 2822 file_exists (file) m ^ and $ match lines Thu, 31 Jul 2008 18:30:13 +0100 fopen (file, mode) U Ungreedy matching fread (handle, len) e Evaluate replacement 1. 0 is Sunday, 6 is Saturday. fwrite (handle, str) x Pattern over several lines readfile (file) 2. Week that overlaps two years belongs to year that contains most days of that Date and Time Functions week. Hence week number for 1st fopen() Modes checkdate (month, day, year) January of a given year can be 53 if r Read date (format, timestamp) week belongs to previous year. r+ Read and write, prepend getdate (timestamp) date("W", mktime(0, 0, 0, 12, 8, w Write, truncate mktime (hr, min, sec, month, day, yr) $year)) always gives correct number of w+ Read and write, truncate strftime (formatstring, timestamp) weeks in $year. a Write, append strtotime (str) a+ Read and write, append time () 3. The Epoch is the 1st January 1970. Available free from AddedBytes.com 4. With leading zeroes