previousUtilisation avancée (Previous) (Next) PHP_Compat::loadConstantnext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

PHP_Compat::loadFunction

PHP_Compat::loadFunction() – Charge une fonction ou un tableau de fonctions

Synopsis

require_once 'PHP/Compat.php';

mixed PHP_Compat::loadFunction ( mixed $function )

Description

Charge une fonction ou un tableau de fonctions.

Parameter

mixed $function

Le nom ou un tableau de noms de fonctions à charger

Return value

mixed

  • TRUE si la fonction a été chargée.
  • FALSE si la fonction n'a pas été chargée. Soit la fonction n'a pû être incluse, soit elle est déjà définie.
  • Si vous spécifiez un tableau de fonctions à carger, un tableau de valeurs TRUE/FALSE est retoruné.

Example

Chargement d'une fonction avec la classe :

<?php
require_once 'PHP/Compat.php';

// Chargement de file_put_contents
PHP_Compat::loadFunction('file_put_contents');

// Chargement de str_split, array_chunk et file_get_contents
PHP_Compat::loadFunction(array('str_split''array_chunk''file_get_contents'));
?>

Vous pouvez également charger une fonction sans utiliser la classe.

Chargement d'une fonction manuellement :

<?php
require_once 'PHP/Compat/Function/file_put_contents.php';
?>

Note

This function should be called statically.

previousUtilisation avancée (Previous) (Next) PHP_Compat::loadConstantnext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.