PHP function
Résolu/Fermé
A voir également:
- PHP function
- Easy php - Télécharger - Divers Web & Internet
- Php?id=1 - Forum PHP
- Function at 0x python ✓ - Forum Python
- \R php ✓ - Forum PHP
- Br php ✓ - Forum PHP
3 réponses
xMiLeY
Messages postés
68
Date d'inscription
jeudi 3 juin 2010
Statut
Membre
Dernière intervention
15 juin 2010
7
4 juin 2010 à 10:16
4 juin 2010 à 10:16
Tu met ta/tes fonction(s) dans un fichier php à part du genre functions.php
Et sur chaque fichier où tu veux l'utiliser tu met:
include "functions.php";
Et sur chaque fichier où tu veux l'utiliser tu met:
include "functions.php";
justoo76
Messages postés
186
Date d'inscription
mardi 13 avril 2010
Statut
Membre
Dernière intervention
23 mars 2016
13
4 juin 2010 à 10:25
4 juin 2010 à 10:25
Oui, sinon tu peux définir ta fonction, du style
function toto(){
//ton code
}
Tu peux la mettre dans un fichier fonctions.php, avec d'autres fonctions.
Puis pour l'appelé , tu indique que tu a besoin du fichier:
require("fonction.php");
toto(); //tu l'appel
function toto(){
//ton code
}
Tu peux la mettre dans un fichier fonctions.php, avec d'autres fonctions.
Puis pour l'appelé , tu indique que tu a besoin du fichier:
require("fonction.php");
toto(); //tu l'appel