SlideShare a Scribd company logo
PHP Functions
Reber Jahwar M.
Chosen functions :
ZIP Functions
Filesystem Functions
Calendar Functions
• The PHP Zip files functions allows you to read and edit or close the ZIP
files.
• The ZIP include 10 different functions :
Functions Description PHP
Zip_close() Closes a ZIP file 4
Zip_entry_close() Closes an entry in the ZIP file 4
zip_entry_compressedsize() Returns the compressed size of an entry in the ZIP file 4
Zip_entry_compressionmethod() Returns the compression method of an entry in the ZIP file 4
Zip_entry_filesize() Returns the actual file size of an entry in the ZIP file 4
Zip_entry_name() Returns the name of an entry in the ZIP file 4
Zip_entry_open() Opens an entry in the ZIP file for reading 4
Zip_enrty_read() Reads from an open entry in the ZIP file 4
Zip_open() Opens a ZIP file 4
Zip_read() Reads the next entry in a ZIP file 4
ZIP Functions
Note : ZIP functions and the Zip library is not enabled by default and
must be downloaded !
<?php
$zip = zip_open("test.zip");
zip_read($zip);
// some code
zip_close($zip);
?>
<?php
$zip = zip_open("test.zip");
{
while ($zip_entry = zip_read($zip))
{
echo "Name: " .
zip_entry_name($zip_entry) ;
echo "Compressed Size: "
zip_entry_compressedsize($zip_entry);
}
zip_close($zip);
}
?>
Examples :
• The PHP filesystem functions allow you to access and manipulate
the system files in the PC .
• Filesystem include more than 70 functions
basename() Returns the filename component of a path 3
disk_total-space() Returns the total size of a directory 4
Is_excutable() Checks whether a file is executable 3
is_uploaded_file() Checks whether a file was uploaded via HTTP POST 3
stat() Returns information about a file 3
realpath() Returns the absolute pathname 4
is_writable() Checks whether a file is writeable 4
fgetc() Returns a character from an open file 3
Filesystem Functions :
Note :The filesystem functions are default no installation needed to use these functions.
<?php
$path = "/CR90/file.php";
echo basename($path) ."<br/>";
?>
<?php
print_r(pathinfo("/CR90/file.txt"));
?>
Output :
(
[dirname] => /CR90
[basename] => file.txt
[extension] => txt
)
Examples :
Output :
file.php
• The calendar functions are useful when working with different calendar
formats and use it inside the PHP code for some reasons .
• The standard it is based on is the Julian day count .
• Julian day count JDC of today is ( 3 February 2013 ) .
• If we want to use another type of calendar format we must first
convert to Julian day count, then to the calendar format.
~ The calendar function in PHP include 18 different type of
functions :
Calendar :
cal_days_in_month() Returns the number of days in a month for a specified year 4
cal_from_jd() Converts a Julian day count into a date of a specified calendar 4
cal_info() Returns information about a given calendar 4
cal_to_jd() Converts a date to Julian day count 4
easter_date() Returns the Unix timestamp for midnight on Easter of a specified year 3
GregorianToJD() Converts a Gregorian date to a Julian day count 3
JDDayOfWeek() Returns the day of a week 3
JDMonthName() Returns a month name 3
JDToGregorian() Converts a Julian day count to a Gregorian date 3
Note :The windows version of PHP has built-in support for the calendar extension. So, the calendar
functions will work automatically..
Calendar Functions :
Output :
There was 30 days in January 2013
Output :
Sunday
<?php
$d=cal_days_in_month(CAL_GREGORIAN,1,2013);
echo("There was $d days in January 2013");
?>
<?php
$jd=cal_to_jd(CAL_GREGORIAN,date("m"),date("d"),date("Y"));
echo(jddayofweek($jd,1));
?>
Examples :
PHP Function
Ad

Recommended

PHP FUNCTIONS
PHP FUNCTIONS
Zeeshan Ahmed
 
Introduction to php web programming - get and post
Introduction to php web programming - get and post
baabtra.com - No. 1 supplier of quality freshers
 
Introduction to php
Introduction to php
Taha Malampatti
 
Php Presentation
Php Presentation
Manish Bothra
 
php
php
ajeetjhajharia
 
MySQL Presentation
MySQL Presentation
Manish Bothra
 
Php technical presentation
Php technical presentation
dharmendra kumar dhakar
 
Introduction to PHP
Introduction to PHP
Collaboration Technologies
 
Overview of PHP and MYSQL
Overview of PHP and MYSQL
Deblina Chowdhury
 
A History of PHP
A History of PHP
Xinchen Hui
 
Introduction to PHP
Introduction to PHP
Bradley Holt
 
PHP Presentation
PHP Presentation
JIGAR MAKHIJA
 
PHP BASIC PRESENTATION
PHP BASIC PRESENTATION
krutitrivedi
 
PHP Tutorials
PHP Tutorials
Yuriy Krapivko
 
PHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginners
Mohammed Mushtaq Ahmed
 
Php Ppt
Php Ppt
Hema Prasanth
 
Lean Php Presentation
Lean Php Presentation
Alan Pinstein
 
Last train to php 7
Last train to php 7
Damien Seguy
 
Introduction To PHP
Introduction To PHP
Shweta A
 
PHP in one presentation
PHP in one presentation
Milad Rahimi
 
PHP - Introduction to PHP Date and Time Functions
PHP - Introduction to PHP Date and Time Functions
Vibrant Technologies & Computers
 
Php ppt
Php ppt
Sanmuga Nathan
 
What Is Php
What Is Php
AVC
 
01 Php Introduction
01 Php Introduction
Geshan Manandhar
 
Class 6 - PHP Web Programming
Class 6 - PHP Web Programming
Ahmed Swilam
 
Beginners PHP Tutorial
Beginners PHP Tutorial
alexjones89
 
Php introduction
Php introduction
krishnapriya Tadepalli
 
PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015
Colin O'Dell
 
4-chapter-File & Directores.pptx debre CTABOUR UNIversit
4-chapter-File & Directores.pptx debre CTABOUR UNIversit
alemunuruhak9
 
Php 7 - YNS
Php 7 - YNS
Alex Amistad
 

More Related Content

What's hot (20)

Overview of PHP and MYSQL
Overview of PHP and MYSQL
Deblina Chowdhury
 
A History of PHP
A History of PHP
Xinchen Hui
 
Introduction to PHP
Introduction to PHP
Bradley Holt
 
PHP Presentation
PHP Presentation
JIGAR MAKHIJA
 
PHP BASIC PRESENTATION
PHP BASIC PRESENTATION
krutitrivedi
 
PHP Tutorials
PHP Tutorials
Yuriy Krapivko
 
PHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginners
Mohammed Mushtaq Ahmed
 
Php Ppt
Php Ppt
Hema Prasanth
 
Lean Php Presentation
Lean Php Presentation
Alan Pinstein
 
Last train to php 7
Last train to php 7
Damien Seguy
 
Introduction To PHP
Introduction To PHP
Shweta A
 
PHP in one presentation
PHP in one presentation
Milad Rahimi
 
PHP - Introduction to PHP Date and Time Functions
PHP - Introduction to PHP Date and Time Functions
Vibrant Technologies & Computers
 
Php ppt
Php ppt
Sanmuga Nathan
 
What Is Php
What Is Php
AVC
 
01 Php Introduction
01 Php Introduction
Geshan Manandhar
 
Class 6 - PHP Web Programming
Class 6 - PHP Web Programming
Ahmed Swilam
 
Beginners PHP Tutorial
Beginners PHP Tutorial
alexjones89
 
Php introduction
Php introduction
krishnapriya Tadepalli
 
PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015
Colin O'Dell
 
A History of PHP
A History of PHP
Xinchen Hui
 
Introduction to PHP
Introduction to PHP
Bradley Holt
 
PHP BASIC PRESENTATION
PHP BASIC PRESENTATION
krutitrivedi
 
PHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginners
Mohammed Mushtaq Ahmed
 
Lean Php Presentation
Lean Php Presentation
Alan Pinstein
 
Last train to php 7
Last train to php 7
Damien Seguy
 
Introduction To PHP
Introduction To PHP
Shweta A
 
PHP in one presentation
PHP in one presentation
Milad Rahimi
 
What Is Php
What Is Php
AVC
 
Class 6 - PHP Web Programming
Class 6 - PHP Web Programming
Ahmed Swilam
 
Beginners PHP Tutorial
Beginners PHP Tutorial
alexjones89
 
PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015
Colin O'Dell
 

Similar to PHP Function (20)

4-chapter-File & Directores.pptx debre CTABOUR UNIversit
4-chapter-File & Directores.pptx debre CTABOUR UNIversit
alemunuruhak9
 
Php 7 - YNS
Php 7 - YNS
Alex Amistad
 
Unit_V_Files handling in c programming language.pptx
Unit_V_Files handling in c programming language.pptx
raushankumarthakur7
 
First Steps in Python Programming
First Steps in Python Programming
Dozie Agbo
 
File Handling in C
File Handling in C
vishnupriyapm4
 
File Handling in C .pptx
File Handling in C .pptx
Ayshwarya Baburam
 
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
lailoesakhan
 
Functions and Header files ver very useful
Functions and Header files ver very useful
RamSiddesh1
 
WEB TECHNOLOGIES- PHP Programming
WEB TECHNOLOGIES- PHP Programming
Jyothishmathi Institute of Technology and Science Karimnagar
 
Business logic with PostgreSQL and Python
Business logic with PostgreSQL and Python
Hubert Piotrowski
 
File handling.pptx
File handling.pptx
VishuSaini22
 
Python chapter presentation details.pptx
Python chapter presentation details.pptx
linatalole2001
 
File Handling in C.pptx
File Handling in C.pptx
DrJasmineBeulahG
 
An introduction to PHP : PHP and Using PHP, Variables Program control and Bui...
An introduction to PHP : PHP and Using PHP, Variables Program control and Bui...
Vigneshkumar Ponnusamy
 
object oriented programming in PHP & Functions
object oriented programming in PHP & Functions
BackiyalakshmiVenkat
 
My self learing -Php
My self learing -Php
laavanyaD2009
 
My self learn -Php
My self learn -Php
laavanyaD2009
 
File management
File management
sumathiv9
 
Introduction to PHP.pptx
Introduction to PHP.pptx
SherinRappai
 
Php advance
Php advance
Rattanjeet Singh
 
4-chapter-File & Directores.pptx debre CTABOUR UNIversit
4-chapter-File & Directores.pptx debre CTABOUR UNIversit
alemunuruhak9
 
Unit_V_Files handling in c programming language.pptx
Unit_V_Files handling in c programming language.pptx
raushankumarthakur7
 
First Steps in Python Programming
First Steps in Python Programming
Dozie Agbo
 
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
lailoesakhan
 
Functions and Header files ver very useful
Functions and Header files ver very useful
RamSiddesh1
 
Business logic with PostgreSQL and Python
Business logic with PostgreSQL and Python
Hubert Piotrowski
 
File handling.pptx
File handling.pptx
VishuSaini22
 
Python chapter presentation details.pptx
Python chapter presentation details.pptx
linatalole2001
 
An introduction to PHP : PHP and Using PHP, Variables Program control and Bui...
An introduction to PHP : PHP and Using PHP, Variables Program control and Bui...
Vigneshkumar Ponnusamy
 
object oriented programming in PHP & Functions
object oriented programming in PHP & Functions
BackiyalakshmiVenkat
 
My self learing -Php
My self learing -Php
laavanyaD2009
 
File management
File management
sumathiv9
 
Introduction to PHP.pptx
Introduction to PHP.pptx
SherinRappai
 
Ad

Recently uploaded (20)

Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
 
How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0
Anchore
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
SAP Datasphere Catalog L2 (2024-02-07).pptx
SAP Datasphere Catalog L2 (2024-02-07).pptx
HimanshuSachdeva46
 
What is data visualization and how data visualization tool can help.pdf
What is data visualization and how data visualization tool can help.pdf
Varsha Nayak
 
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
joybepari360
 
Rierino Commerce Platform - CMS Solution
Rierino Commerce Platform - CMS Solution
Rierino
 
Reimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AI
Maxim Salnikov
 
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Safe Software
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
Zoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutions
reenashriee
 
Making significant Software Architecture decisions
Making significant Software Architecture decisions
Bert Jan Schrijver
 
Transmission Media. (Computer Networks)
Transmission Media. (Computer Networks)
S Pranav (Deepu)
 
Insurance Underwriting Software Enhancing Accuracy and Efficiency
Insurance Underwriting Software Enhancing Accuracy and Efficiency
Insurance Tech Services
 
Artificial Intelligence Workloads and Data Center Management
Artificial Intelligence Workloads and Data Center Management
SandeepKS52
 
What is data visualization and how data visualization tool can help.pptx
What is data visualization and how data visualization tool can help.pptx
Varsha Nayak
 
UPDASP a project coordination unit ......
UPDASP a project coordination unit ......
withrj1
 
Advanced Token Development - Decentralized Innovation
Advanced Token Development - Decentralized Innovation
arohisinghas720
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
 
How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0
Anchore
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
SAP Datasphere Catalog L2 (2024-02-07).pptx
SAP Datasphere Catalog L2 (2024-02-07).pptx
HimanshuSachdeva46
 
What is data visualization and how data visualization tool can help.pdf
What is data visualization and how data visualization tool can help.pdf
Varsha Nayak
 
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
joybepari360
 
Rierino Commerce Platform - CMS Solution
Rierino Commerce Platform - CMS Solution
Rierino
 
Reimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AI
Maxim Salnikov
 
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Automated Migration of ESRI Geodatabases Using XML Control Files and FME
Safe Software
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
Zoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutions
reenashriee
 
Making significant Software Architecture decisions
Making significant Software Architecture decisions
Bert Jan Schrijver
 
Transmission Media. (Computer Networks)
Transmission Media. (Computer Networks)
S Pranav (Deepu)
 
Insurance Underwriting Software Enhancing Accuracy and Efficiency
Insurance Underwriting Software Enhancing Accuracy and Efficiency
Insurance Tech Services
 
Artificial Intelligence Workloads and Data Center Management
Artificial Intelligence Workloads and Data Center Management
SandeepKS52
 
What is data visualization and how data visualization tool can help.pptx
What is data visualization and how data visualization tool can help.pptx
Varsha Nayak
 
UPDASP a project coordination unit ......
UPDASP a project coordination unit ......
withrj1
 
Advanced Token Development - Decentralized Innovation
Advanced Token Development - Decentralized Innovation
arohisinghas720
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
Ad

PHP Function

  • 2. Chosen functions : ZIP Functions Filesystem Functions Calendar Functions
  • 3. • The PHP Zip files functions allows you to read and edit or close the ZIP files. • The ZIP include 10 different functions : Functions Description PHP Zip_close() Closes a ZIP file 4 Zip_entry_close() Closes an entry in the ZIP file 4 zip_entry_compressedsize() Returns the compressed size of an entry in the ZIP file 4 Zip_entry_compressionmethod() Returns the compression method of an entry in the ZIP file 4 Zip_entry_filesize() Returns the actual file size of an entry in the ZIP file 4 Zip_entry_name() Returns the name of an entry in the ZIP file 4 Zip_entry_open() Opens an entry in the ZIP file for reading 4 Zip_enrty_read() Reads from an open entry in the ZIP file 4 Zip_open() Opens a ZIP file 4 Zip_read() Reads the next entry in a ZIP file 4 ZIP Functions
  • 4. Note : ZIP functions and the Zip library is not enabled by default and must be downloaded ! <?php $zip = zip_open("test.zip"); zip_read($zip); // some code zip_close($zip); ?> <?php $zip = zip_open("test.zip"); { while ($zip_entry = zip_read($zip)) { echo "Name: " . zip_entry_name($zip_entry) ; echo "Compressed Size: " zip_entry_compressedsize($zip_entry); } zip_close($zip); } ?> Examples :
  • 5. • The PHP filesystem functions allow you to access and manipulate the system files in the PC . • Filesystem include more than 70 functions basename() Returns the filename component of a path 3 disk_total-space() Returns the total size of a directory 4 Is_excutable() Checks whether a file is executable 3 is_uploaded_file() Checks whether a file was uploaded via HTTP POST 3 stat() Returns information about a file 3 realpath() Returns the absolute pathname 4 is_writable() Checks whether a file is writeable 4 fgetc() Returns a character from an open file 3 Filesystem Functions :
  • 6. Note :The filesystem functions are default no installation needed to use these functions. <?php $path = "/CR90/file.php"; echo basename($path) ."<br/>"; ?> <?php print_r(pathinfo("/CR90/file.txt")); ?> Output : ( [dirname] => /CR90 [basename] => file.txt [extension] => txt ) Examples : Output : file.php
  • 7. • The calendar functions are useful when working with different calendar formats and use it inside the PHP code for some reasons . • The standard it is based on is the Julian day count . • Julian day count JDC of today is ( 3 February 2013 ) . • If we want to use another type of calendar format we must first convert to Julian day count, then to the calendar format. ~ The calendar function in PHP include 18 different type of functions : Calendar :
  • 8. cal_days_in_month() Returns the number of days in a month for a specified year 4 cal_from_jd() Converts a Julian day count into a date of a specified calendar 4 cal_info() Returns information about a given calendar 4 cal_to_jd() Converts a date to Julian day count 4 easter_date() Returns the Unix timestamp for midnight on Easter of a specified year 3 GregorianToJD() Converts a Gregorian date to a Julian day count 3 JDDayOfWeek() Returns the day of a week 3 JDMonthName() Returns a month name 3 JDToGregorian() Converts a Julian day count to a Gregorian date 3 Note :The windows version of PHP has built-in support for the calendar extension. So, the calendar functions will work automatically.. Calendar Functions :
  • 9. Output : There was 30 days in January 2013 Output : Sunday <?php $d=cal_days_in_month(CAL_GREGORIAN,1,2013); echo("There was $d days in January 2013"); ?> <?php $jd=cal_to_jd(CAL_GREGORIAN,date("m"),date("d"),date("Y")); echo(jddayofweek($jd,1)); ?> Examples :