- basename – It returns trailing name component of path
- chgrp – It can be used to change file group
- chmod – It can be used to change file permission
- chown – It can be used to change file ownership
- clearstatcache – It can be used to clears file status cache
- copy – It can be used to copy file
- delete – Check unlink() or unset()
- dirname – It returns parent directory’s path
- disk_free_space – It returns available space on filesystem or disk partition
- disk_total_space – It returns the total size of a filesystem or disk partitio
- diskfreespace – Its an alias of disk_free_space()
- fclose – It closes an open file pointer
- feof – It checks for end-of-file on a file pointer
- fflush – It flushes the output to a file
- fgetc – It returns character from file pointer
- fgetcsv – It returns line from file pointer and parse for CSV fields
- fgets – It returns line from file pointer
- fgetss – It returns line from file pointer and strip HTML tags
- file_exists – It checks whether a file or directory exists
- file_get_contents – It reads entire file
- file_put_contents – It writes a string to a file
- file – It reads entire file into an array
- fileatime – It returns last access time of file
- filectime – It returns inode change time of file
- filegroup – It returns file group
- fileinode – It returns file inode
- filemtime – It returns file modification time
- fileowner – It returns file owner
- fileperms – It returns file permissions
- filesize – It returns file size
- filetype – It returns file type
- flock – It can be used to lock the file
- fnmatch – Match filename against a pattern
- fopen – It opens file or URL
- fpassthru – It outputs all remaining data on a file pointer
- fputcsv – It format line as CSV and write to file pointer
- fputs – Its an alias of fwrite() and writes to a file
- fread – It can be used to read the content from a file
- fscanf – It parses input from a file according to a format
- fseek – It seeks on a file pointer
- fstat – It returns information about a file using an open file pointer
- ftell – It returns the current position of the file pointer
- ftruncate – It truncates a file to a given length
- fwrite – It writes the string to a file
- glob – It finds pathnames matching a pattern
- is_dir – It checks whether the filename is a directory
- is_executable – It checks whether the filename is executable
- is_file – It checks whether the filename is a regular file
- is_link – It checks whether the filename is a symbolic link
- is_readable – It checks whether the file exists and is readable
- is_uploaded_file – It checks whether the file was uploaded via HTTP POST
- is_writable – It checks whether the filename is writable
- is_writeable – Its an Alias of is_writable() and checks whether the filename is writable
- lchgrp – It changes group ownership of symlink
- lchown – It changes user ownership of symlink
- link – It creates a hard link
- linkinfo – It returns information about a link
- lstat – It returns information about a file or symbolic link
- mkdir – It can be used to create directory
- move_uploaded_file – It moves an uploaded file to a new location
- parse_ini_file – It parses a configuration file
- parse_ini_string – It parse a configuration string
- pathinfo – It returns information about a file path
- pclose – It closes process file pointer
- popen – It opens process file pointer
- readfile – It outputs a file
- readlink – It returns the target of a symbolic link
- realpath_cache_get – It returns realpath cache entries
- realpath_cache_size – It returns realpath cache size
- realpath – It returns canonicalized absolute pathname
- rename – It renames a file or directory
- rewind – It rewinds the position of a file pointer
- rmdir – It can be used to remove a directory
- set_file_buffer – Its an alias of stream_set_write_buffer()
- stat – It returns information about a file
- symlink – It creates a symbolic link
- tempnam – It create file with unique file name
- tmpfile – It creates a temporary file
- touch – It sets access and modification time of file
- umask – It changes file permissions of file
- unlink – It deletes the file
Tag Archives: PHP
Error functions
- debug_backtrace – It generate a generates a backtrace
- debug_print_backtrace – It prints a backtrace
- error_get_last – It returns the last error occurred
- error_log – It sends an error to the server error-log
- error_reporting – It specifies which errors are occurred.
- restore_error_handler – It restores the previous error handler
- restore_exception_handler – It r restores the previous exception handler
- set_error_handler – It sets a user-defined function to handle errors
- set_exception_handler – It sets a user-defined function to handle exception
- trigger_error – It can be used to create a custom error message .
- user_error – Its an alias of trigger_error()
Directory functions
- chdir – It can be used to change directory
- chroot – It can be used to change the root directory
- closedir – It closes directory handle
- dir – It return an instance of the Directory class
- getcwd – It returns the current working directory
- opendir – It opens directory handle
- readdir – It reads entry from directory handle
- rewinddir – It rewinds directory handle
- scandir – It lists files and directories of a given path.
Calendar functions
- cal_days_in_month – It returns the number of days in a month for a given year and calendar
- cal_from_jd – It converts from Julian Day Count to a supported calendar
- cal_info – It returns information about a particular calendar
- cal_to_jd – It converts from a supported calendar to Julian Day Count.
- easter_date – It returns the unix timestamp of easter date for a given year
- easter_days – It returns the no of days between March 21 and Easter day of a given year.
- FrenchToJD – It converts a date from the French Republican Calendar to a Julian Day Count
- GregorianToJD – It converts a Gregorian date to Julian Day Count
- JDDayOfWeek – It returns the day of the week
- JDMonthName – It returns a month name
- JDToFrench – It converts a Julian Day Count to the French Republican Calendar
- JDToGregorian – It converts Julian Day Count to Gregorian date
- jdtojewish – It converts a Julian day count to a Jewish calendar date
- JDToJulian – It converts a Julian Day Count to a Julian Calendar Date
- jdtounix – It convert Julian Day to Unix timestamp
- JewishToJD – It converts a date in the Jewish Calendar to Julian Day Count
- JulianToJD – It converts a Julian Calendar date to Julian Day Count
- unixtojd – It convert Unix timestamp to Julian Day
Array functions
- array_change_key_case – It converts the keys of an array into uppercase
- array_chunk – It splits an array into chunks
- array_combine – It creates an array by using one array for keys and another for its values
- array_count_values – It counts all the values of an array
- array_diff_assoc – It computes the difference of arrays with additional index check
- array_diff_key – It computes the difference of arrays using keys for comparison
- array_diff_uassoc – It computes the difference of arrays with additional index
- array_diff_ukey – It computes the difference of arrays using a callback function on the keys for comparison
- array_diff – It finds the difference of arrays
- array_fill_keys – It fills an array with values, specifying keys
- array_fill – It fills an array with the given values
- array_filter – It filters elements of an array using a callback function
- array_flip – It exchanges all keys with their associated values in an array
- array_intersect_assoc – It finds the intersection of arrays with additional index check
- array_intersect_key – It finds the intersection of arrays using keys for comparison
- array_intersect_uassoc – It finds the intersection of arrays with additional index check, compares indexes by a callback function
- array_intersect_ukey – It finds the intersection of arrays using a callback function on the keys for comparison
- array_intersect – It finds the intersection of arrays
- array_key_exists – It checks if the given key or index exists in the array
- array_keys – It returns all the keys or a subset of the keys of an array
- array_map – It applies the callback to the elements of the given arrays
- array_merge_recursive – It merges two or more arrays recursively
- array_merge – It merge arrays
- array_multisort – It sorts multiple or multi-dimensional arrays
- array_pad – It pads array to the specified length with a value
- array_pop – It pops the last element of an array
- array_product – It finds the product of values in an array
- array_push It pushes one or more elements onto the end of array
- array_rand – It fetches one or more random entries out of an array
- array_reduce – It reduce the array to a single value using a callback function
- array_replace_recursive – It replaces elements from passed arrays into the first array recursively
- array_replace – It replaces elements from passed arrays into the first array
- array_reverse – It returns an array with elements in reverse order
- array_search – It searches the array for a given value
- array_shift – It shift an element off the beginning of array
- array_slice – It extracts a slice of the array
- array_splice – It removes a portion of the array and replace it with something else
- array_sum – It finds the sum of values in an array
- array_udiff_assoc – It finds the difference of arrays with additional index check
- array_udiff_uassoc – It finds the difference of arrays with additional index check
- array_udiff – It finds the difference of arrays by using a callback function for data comparison
- array_uintersect_assoc – It finds the intersection of arrays with additional index check,
- array_uintersect_uassoc – It finds the intersection of arrays with additional index check, compares data and indexes by a callback functions
- array_uintersect – It finds the intersection of arrays, compares data by a callback function
- array_unique – It removes duplicate values from an array
- array_unshift – It prepend one or more elements to the beginning of an array
- array_values – It return all the values of an array
- array_walk_recursive – It applay a user function recursively to every member of an array
- array_walk – It apply a user function to every member of an array
- array – It can be used to create an array
- arsort – It sort an array in reverse order and maintain index association
- asort – It sort an array and maintain index association
- compact – it create array containing variables and their values
- count – It Count all elements in an array
- current – It returns the current element in an array
- each – It return the current key and value pair from an array
- end – It sets the internal pointer of an array to its last element
- extract – It import variables into the current symbol table from an array
- in_array It checks if a value exists in an array
- key – It fetches a key from an array
- krsort – It sorts an array by key in reverse order
- ksort – It sorts an array by key
- list – It assigns variables as if they were an array
- natcasesort – It sorts an array using a case insensitive “natural order” algorithm
- natsort – It sorts an array using a “natural order” algorithm
- next – It moves the internal array pointer of an array
- pos – It is an alias of current()
- prev – It rewinds the internal array pointer
- range – It can be used to create an array containing a range of elements
- reset – it set the internal pointer of an array to its first element
- rsort – It sorts the array in reverse order
- shuffle – It shuffles the array
- sizeof – It an alias of count()
- sort – It sorts the array
- uasort – It sorts an array with a user-defined comparison function and maintain index association
- uksort – It sorts an array by keys using a user-defined comparison function
- usort – It sorts an array by keys using a user-defined comparison function
Math functions
- abs – It returns absolute value
- acos – It returns arccosine value
- acosh – It returns Inverse hyperbolic cosine
- asin – It returns arc sine
- asinh – It returns Inverse hyperbolic sine
- atan2 – It returns Arc tangent of two variables
- atan – It returns Arc tangent
- atanh – It returns Inverse hyperbolic tangent
- base_convert – It convert a number between arbitrary bases
- bindec – It converts binary number to decimal number
- ceil – It round the fractions up
- cos – It returns cosine value .
- cosh – It returns Hyperbolic cosine .
- decbin – It converts a decimal to binary
- dechex – It converts a decimal to hexadecimal
- decoct – It converts a decimal to octal
- deg2rad – It converts the number in degrees to the radian equivalent
- exp – It calculates the exponent of e
- expm1 – It calculates the value of Ex-1
- floor – It round fractions down
- fmod – It returns the remainder of the division.
- getrandmax – It shows largest possible random value
- hexdec – It converts Hexadecimal to decimal
- hypot – It calculate the length of the hypotenuse
- is_finite – It checks whether a value is a legal finite number
- is_infinite – It checks whether a value is a legal infinite number
- is_nan – It checks whether a value is not a number
- lcg_value – It returns combined linear congruential generator
- log10 – It returns Base-10 logarithm value
- log1p – It returns log(1+x)
- log – It returns natural logarithm
- max – It returns maximum value
- min – It returns lowest value
- mt_getrandmax – It returns largest possible random value
- mt_rand – It generates a better random value
- mt_srand – It seed the better random number generator
- octdec – It converts octal number to decimal
- pi – It returns the value of pi
- pow – It returns Exponential expression
- rad2deg – It converts the radian number to the equivalent number in degrees
- rand – It generates a random integer
- round – It rounds a float
- sin – it returns sine value
- sinh – it returns hyperbolic sine
- sqrt – It returns Square root
- srand – It seed the random number generator
- tan – It returns tangent value
- tanh – It returns hyperbolic tangent
timezone_open
<?php
$date = date_create( ‘2007-05-17’);
$timezone = timezone_open ( ‘Australia/Perth’ );
date_timezone_set( $date, $timezone );
$dateTimeZone = date_timezone_get($date);
echo ‘TimeZone is ‘. timezone_name_get($dateTimeZone);
?>
Output
TimeZone is Australia/Perth
DateTimeZone::__construct
<?php
$date = new DateTime(‘now’, new DateTimeZone(‘Asia/Calcutta’));
$time = $date->format(‘H:i’);
echo $time;
?>
Output
17:53
timezone_transitions_get
Its an alias of DateTimeZone::getTransitions() and returns all transitions for the timezone
Example
<?php
echo “<pre>”;
$tz = new DateTimeZone(“Australia/Perth”);
print_r(timezone_transitions_get($tz));
?>
Output
It will list all transitions of the timezone
DateTimeZone::getTransitions
<?php
echo “<pre>”;
$tz = new DateTimeZone(“Europe/London”);
$tzTransitions = $tz ->getTransitions();
print_r(array_slice($tzTransitions, 0, 2));
?>
Output
Array
(
[0] => Array
(
[ts] => -2147483648
[time] => 1901-12-13T20:45:52+0000
[offset] => 3600
[isdst] => 1
[abbr] => BST
)
[1] => Array
(
[ts] => -1691964000
[time] => 1916-05-21T02:00:00+0000
[offset] => 3600
[isdst] => 1
[abbr] => BST
)
)