Back to the module list

Conversion of format

This class allow to convert a format to another one

The class definition

Class \convert

Namespace \


 Convert a format to another one


No property available


static public function convertDate ($inputDate, $inputFormat, $outputFormat, $exception=true)
 Convert Date received in one format to another.
 If the provided string is not corresponding to the format, generate an
 exception or return the original string
 Format used
 Do not accept the locale ! The language of the dates is always in english
 @param string $inputDate The date to modify
 @param string $inputFormat The input format of the date
 @param string $outputFormat The output format of the date
 @param boolean|null $exception If set, generate an exception if the
 provided date is invalid
 @return string

static public function ucfirst ($str)
 Convert the first char to capital and the rest of the sentence in
 lowercase (like ucfirst, but UTF8 compliant)
 @param string $str The string to convert

static public function ucwords ($str, $delimiters=" ")
 Convert the first char of each word of a sentence to capital. The word
 delimiter can be provided.
 The sentence is in UTF-8.
 The sentence is converted to lowercase before doing the action (in
 contrary of the original PHP function)
 @param string $str The string to convert
 @param string $delimiters The delimiters (by default " \t\r\n\f\v")
 @return string