4.4 Slides - Built-In Functions
4.4 Slides - Built-In Functions
UNIT NO 4
PHP and XML
● Built-in functions
III V
20CSPC501
INTERNET PROGRAMMING
20CSPC501
INTERNET PROGRAMMING
PHP function
● piece of code that can be reused many times.
● thousands of built-in functions in PHP
Advantages
● Code Reusability: PHP functions are defined only once and can be
invoked many times, like in other programming languages
● Less Code: It saves a lot of code because you don't need to write the
logic many times. By the use of function, you can write the logic only once
and reuse it.
● Easy to understand: PHP functions separate the programming logic. So it
is easier to understand the flow of the application because every logic is
divided in the form of functions.
20CSPC501
INTERNET PROGRAMMING
Creating a Function
Date Function
Build in Functions
Build in Functions
Build in functions
PHP Filesystem Introduction
The filesystem functions allow you to access and manipulate the filesystem.
Installation
The filesystem functions are part of the PHP core. There is no installation needed to use
these functions.
Unix / Windows Compatibility
When specifying a path on Unix platforms, a forward slash (/) is used as directory
separator.
On Windows platforms, both forward slash (/) and backslash (\) can be used.
Build in Functions
PHP libxml Introduction
The libxml functions and constants are used together with SimpleXML, XSLT and DOM
functions.
Installation
These functions require the libxml package. Download at xmlsoft.org
Build in functions
PHP Stream Introduction
Streams are the way of generalizing file, network, data compression, and other operations
which share a common set of functions and uses. In its simplest definition, a stream is a
resource object which exhibits streamable behavior. That is, it can be read from or written
to in a linear fashion, and may be able to fseek() to an arbitrary location within the stream.
A wrapper is additional code which tells the stream how to handle specific
protocols/encodings.