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

More Related Content

What's hot

Overview of PHP and MYSQL
Overview of PHP and MYSQLOverview of PHP and MYSQL
Overview of PHP and MYSQL
Deblina Chowdhury
 
A History of PHP
A History of PHPA History of PHP
A History of PHP
Xinchen Hui
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
Bradley Holt
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
JIGAR MAKHIJA
 
PHP BASIC PRESENTATION
PHP BASIC PRESENTATIONPHP BASIC PRESENTATION
PHP BASIC PRESENTATION
krutitrivedi
 
PHP Tutorials
PHP TutorialsPHP Tutorials
PHP Tutorials
Yuriy Krapivko
 
PHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginnersPHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginners
Mohammed Mushtaq Ahmed
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
Alan Pinstein
 
Last train to php 7
Last train to php 7Last train to php 7
Last train to php 7
Damien Seguy
 
Introduction To PHP
Introduction To PHPIntroduction To PHP
Introduction To PHP
Shweta A
 
PHP in one presentation
PHP in one presentationPHP in one presentation
PHP in one presentation
Milad Rahimi
 
PHP - Introduction to PHP Date and Time Functions
PHP -  Introduction to  PHP Date and Time FunctionsPHP -  Introduction to  PHP Date and Time Functions
PHP - Introduction to PHP Date and Time Functions
Vibrant Technologies & Computers
 
What Is Php
What Is PhpWhat Is Php
What Is Php
AVC
 
01 Php Introduction
01 Php Introduction01 Php Introduction
01 Php Introduction
Geshan Manandhar
 
Class 6 - PHP Web Programming
Class 6 - PHP Web ProgrammingClass 6 - PHP Web Programming
Class 6 - PHP Web Programming
Ahmed Swilam
 
Beginners PHP Tutorial
Beginners PHP TutorialBeginners PHP Tutorial
Beginners PHP Tutorialalexjones89
 
PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015
Colin O'Dell
 

What's hot (20)

Overview of PHP and MYSQL
Overview of PHP and MYSQLOverview of PHP and MYSQL
Overview of PHP and MYSQL
 
A History of PHP
A History of PHPA History of PHP
A History of PHP
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
PHP BASIC PRESENTATION
PHP BASIC PRESENTATIONPHP BASIC PRESENTATION
PHP BASIC PRESENTATION
 
PHP Tutorials
PHP TutorialsPHP Tutorials
PHP Tutorials
 
PHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginnersPHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginners
 
Php Ppt
Php PptPhp Ppt
Php Ppt
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 
Last train to php 7
Last train to php 7Last train to php 7
Last train to php 7
 
Introduction To PHP
Introduction To PHPIntroduction To PHP
Introduction To PHP
 
PHP in one presentation
PHP in one presentationPHP in one presentation
PHP in one presentation
 
PHP - Introduction to PHP Date and Time Functions
PHP -  Introduction to  PHP Date and Time FunctionsPHP -  Introduction to  PHP Date and Time Functions
PHP - Introduction to PHP Date and Time Functions
 
Php ppt
Php pptPhp ppt
Php ppt
 
What Is Php
What Is PhpWhat Is Php
What Is Php
 
01 Php Introduction
01 Php Introduction01 Php Introduction
01 Php Introduction
 
Class 6 - PHP Web Programming
Class 6 - PHP Web ProgrammingClass 6 - PHP Web Programming
Class 6 - PHP Web Programming
 
Beginners PHP Tutorial
Beginners PHP TutorialBeginners PHP Tutorial
Beginners PHP Tutorial
 
Php introduction
Php introductionPhp introduction
Php introduction
 
PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015
 

Similar to PHP Function

Php 7 - YNS
Php 7 - YNSPhp 7 - YNS
Php 7 - YNS
Alex Amistad
 
Unit_V_Files handling in c programming language.pptx
Unit_V_Files handling in c programming language.pptxUnit_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 ProgrammingFirst Steps in Python Programming
First Steps in Python Programming
Dozie Agbo
 
File Handling in C
File Handling in CFile Handling in C
File Handling in C
vishnupriyapm4
 
File Handling in C .pptx
File Handling in C .pptxFile 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.pdfProgFund_Lecture_4_Functions_and_Modules-1.pdf
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
lailoesakhan
 
WEB TECHNOLOGIES- PHP Programming
WEB TECHNOLOGIES-  PHP ProgrammingWEB TECHNOLOGIES-  PHP Programming
Business logic with PostgreSQL and Python
Business logic with PostgreSQL and PythonBusiness logic with PostgreSQL and Python
Business logic with PostgreSQL and Python
Hubert Piotrowski
 
File handling.pptx
File handling.pptxFile handling.pptx
File handling.pptx
VishuSaini22
 
File Handling in C.pptx
File Handling in C.pptxFile Handling in C.pptx
File Handling in C.pptx
DrJasmineBeulahG
 
My self learing -Php
My self learing -PhpMy self learing -Php
My self learing -PhplaavanyaD2009
 
File management
File managementFile management
File management
sumathiv9
 
Introduction to PHP.pptx
Introduction to PHP.pptxIntroduction to PHP.pptx
Introduction to PHP.pptx
SherinRappai
 
Php advance
Php advancePhp advance
Php advance
Rattanjeet Singh
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction PresentationNerd Tzanetopoulos
 
5.1 Binary File Handling.pdf
5.1 Binary File Handling.pdf5.1 Binary File Handling.pdf
5.1 Binary File Handling.pdf
keshavkumarsingh263
 
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptxC-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
SKUP1
 
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptxC-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
LECO9
 

Similar to PHP Function (20)

Php 7 - YNS
Php 7 - YNSPhp 7 - YNS
Php 7 - YNS
 
Unit_V_Files handling in c programming language.pptx
Unit_V_Files handling in c programming language.pptxUnit_V_Files handling in c programming language.pptx
Unit_V_Files handling in c programming language.pptx
 
First Steps in Python Programming
First Steps in Python ProgrammingFirst Steps in Python Programming
First Steps in Python Programming
 
File Handling in C
File Handling in CFile Handling in C
File Handling in C
 
File Handling in C .pptx
File Handling in C .pptxFile Handling in C .pptx
File Handling in C .pptx
 
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
ProgFund_Lecture_4_Functions_and_Modules-1.pdfProgFund_Lecture_4_Functions_and_Modules-1.pdf
ProgFund_Lecture_4_Functions_and_Modules-1.pdf
 
WEB TECHNOLOGIES- PHP Programming
WEB TECHNOLOGIES-  PHP ProgrammingWEB TECHNOLOGIES-  PHP Programming
WEB TECHNOLOGIES- PHP Programming
 
Business logic with PostgreSQL and Python
Business logic with PostgreSQL and PythonBusiness logic with PostgreSQL and Python
Business logic with PostgreSQL and Python
 
File handling.pptx
File handling.pptxFile handling.pptx
File handling.pptx
 
File Handling in C.pptx
File Handling in C.pptxFile Handling in C.pptx
File Handling in C.pptx
 
My self learn -Php
My self learn -PhpMy self learn -Php
My self learn -Php
 
My self learing -Php
My self learing -PhpMy self learing -Php
My self learing -Php
 
File management
File managementFile management
File management
 
Introduction to PHP.pptx
Introduction to PHP.pptxIntroduction to PHP.pptx
Introduction to PHP.pptx
 
Php advance
Php advancePhp advance
Php advance
 
Php basics
Php basicsPhp basics
Php basics
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction Presentation
 
5.1 Binary File Handling.pdf
5.1 Binary File Handling.pdf5.1 Binary File Handling.pdf
5.1 Binary File Handling.pdf
 
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptxC-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
 
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptxC-Programming  C LIBRARIES AND USER DEFINED LIBRARIES.pptx
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
 

Recently uploaded

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 

Recently uploaded (20)

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 

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 :