Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Lib.Util.php File Reference

Go to the source code of this file.

Namespaces

namespace  FDL
 

Functions

 newFreeVaultFile ($dbaccess)
 
 getGen ($dbaccess)
 
 toIso8601 ($fdate, $wtz=false)
 
 stringDateToJD ($sdate)
 
 frenchDateToJD ($fdate)
 
 frenchDateToUnixTs ($fdate, $utc=false)
 
 stringDateToLocaleDate ($fdate, $format= '')
 
 frenchDateToLocaleDate ($fdate, $format= '')
 
 frenchDateToIso ($fdate, $withT=true)
 
 iso8601DateToUnixTs ($isodate, $utc=false)
 
 stringDateToUnixTs ($isodate, $utc=false)
 
 stringDateToIso ($date, $format=false, $withT=false)
 
 iso8601ToJD ($isodate)
 
 cal2jd ($era, $y, $m, $d, $h, $mn, $s)
 
 jdWeekDay ($jd)
 
 jdWeekNumber ($jd)
 
 jd2cal ($jd, $dformat= '')
 
 addJsSlashes ($s)
 
 unaccent_ ($text)
 
 unaccent_iso8859_1 ($string)
 
 unaccent_utf8 ($string)
 
 unaccent ($s)
 
 sep_replace ($ak, $idx, $by="-", $sep="\n")
 
 xml_entity_encode ($s)
 

Function Documentation

addJsSlashes (   $s)

backslash quote and replace double-quote by html entity

Definition at line 475 of file Lib.Util.php.

cal2jd (   $era,
  $y,
  $m,
  $d,
  $h,
  $mn,
  $s 
)

Definition at line 301 of file Lib.Util.php.

+ Here is the call graph for this function:

frenchDateToIso (   $fdate,
  $withT = true 
)

convert French date DD/MM/YYYY to iso date must be > 01/01/1970 and < 2038

Parameters
string$fdateDD/MM/YYYY HH:MM
boolean$withTreturn YYYY-MM-DDTHH:MM:SS else YYYY-MM-DD HH:MM:SS
Returns
string YYYY-MM-DD HH:MM:SS

Definition at line 175 of file Lib.Util.php.

frenchDateToJD (   $fdate)

convert French date to Julian day the seconds are ignored

Parameters
string$fdateDD/MM/YYYY HH:MM
Returns
float julian day (return false if incorrect date)

Definition at line 65 of file Lib.Util.php.

+ Here is the call graph for this function:

frenchDateToLocaleDate (   $fdate,
  $format = '' 
)
Parameters
string$fdate
Returns
string

Definition at line 120 of file Lib.Util.php.

+ Here is the call graph for this function:

frenchDateToUnixTs (   $fdate,
  $utc = false 
)

convert French date to unix timestamp date must be > 01/01/1970 and < 2038

Parameters
string$fdateDD/MM/YYYY HH:MM
Returns
float number of second since epoch (return -1 if incorrect date)

Definition at line 78 of file Lib.Util.php.

getGen (   $dbaccess)

Definition at line 24 of file Lib.Util.php.

iso8601DateToUnixTs (   $isodate,
  $utc = false 
)

convert iso date to unix timestamp date must be > 1970-01-01 and < 2038

Parameters
string$isodateYYYY-MM-DD HH:MM
Returns
float number of second since epoch (return -1 if incorrect date)

Definition at line 193 of file Lib.Util.php.

iso8601ToJD (   $isodate)

convert iso8601 date to Julian day the seconds are ignored

Parameters
string$isodateYYYY-MM-DD HH:MM
Returns
float julian day (return false if incorrect date)

Definition at line 293 of file Lib.Util.php.

+ Here is the call graph for this function:

jd2cal (   $jd,
  $dformat = '' 
)

return date in string format

Parameters
float$jdjulian date
string$dformatthe format (default iso8601)
Returns
string the formatted date

Definition at line 383 of file Lib.Util.php.

jdWeekDay (   $jd)

return the day of the week (1 id Monday, 7 is Sunday)

Parameters
float$jdjulian date
Returns
int

Definition at line 356 of file Lib.Util.php.

jdWeekNumber (   $jd)

return the number of the week in year

Parameters
float$jdjulian date
Returns
int between 1 and 53

Definition at line 368 of file Lib.Util.php.

newFreeVaultFile (   $dbaccess)

Definition at line 19 of file Lib.Util.php.

sep_replace (   $ak,
  $idx,
  $by = "-",
  $sep = "\n" 
)

replace a string separate by $sep

Definition at line 551 of file Lib.Util.php.

stringDateToIso (   $date,
  $format = false,
  $withT = false 
)

convert string date to iso

Parameters
string$dateDD/MM/YYYY HH:MM*
string$formatto indicate locale
bool$withTto add a T : YYYY-MM-DDTHH:MM
Returns
string YYYY-MM-DD HH:MM

Definition at line 223 of file Lib.Util.php.

+ Here is the call graph for this function:

stringDateToJD (   $sdate)

Definition at line 53 of file Lib.Util.php.

stringDateToLocaleDate (   $fdate,
  $format = '' 
)
Parameters
string$fdate
Returns
string

Definition at line 93 of file Lib.Util.php.

stringDateToUnixTs (   $isodate,
  $utc = false 
)

convert date to unix timestamp date must be > 1970-01-01 and < 2038

Parameters
string$isodateYYYY-MM-DD HH:MM
Returns
float number of second since epoch (return -1 if incorrect date)

Definition at line 209 of file Lib.Util.php.

+ Here is the call graph for this function:

toIso8601 (   $fdate,
  $wtz = false 
)

convert French date to iso8601

Parameters
string$fdateDD/MM/YYYY HH:MM:SS (CET)
string$wtzwith timezone add time zone in the end if true
Returns
string date YYYY-MM-DD HH:MM:SS
Deprecated:
use stringDateToIso() instead

Definition at line 39 of file Lib.Util.php.

+ Here is the call graph for this function:

unaccent (   $s)

Definition at line 544 of file Lib.Util.php.

+ Here is the call graph for this function:

unaccent_ (   $text)

Remove Character Accents Replaces accented characters in a string with their unaccented versions, for instance, converts "ÉéÜüÄäÖ" into "EeUuAaO". The function will handle any accented character for which there exists an HTML entity in PHP's translation table (i.e. pretty much any and all characters). Credits go to jennings at trad dot uji dot es for the original version of this incredibly useful little function. I used this function to good effect in OpenSEF.

Definition at line 489 of file Lib.Util.php.

unaccent_iso8859_1 (   $string)

Definition at line 510 of file Lib.Util.php.

unaccent_utf8 (   $string)

Definition at line 539 of file Lib.Util.php.

xml_entity_encode (   $s)

change & < and > character to respetiv entity

Parameters
string$sstring to encode
Returns
string encoded string

Definition at line 571 of file Lib.Util.php.

← centre documentaire © anakeen - published under CC License - Dynacase