chantra a dit:if($x>=1 && $x<=10){
//premier tier
}elseif($x>=11 && $x<=20){
//2eme tiers
}else{
3eme
}
muelsaco a dit:Peut être qu'il veut savoir sur quel caractère la lettre X se trouve dans la phrase...
Sinon moi çà m'interresserait de savoir çà ^^
muelsaco a dit:Oui existe-il une fonction qui renvoi la position d'une lettre ou exprésion recherchée?
$jour = date("j");
$mois = date("m");
//echo $mois;
//echo $jour;
/* STAR : Pour le BLOC A */
function blocA() {
switch ($mois) {
case 01 : $starA_title1 = $starJan_title1; $starA_title2 = $starJan_title2;
$starA_text = $starJan_text;
$starA_link = $starJan_link;
$starA_image = $starJan_image;
break;
case 02 : $starA_title1 = $starFev_title1;
$starA_title2 = $starFev_title2;
$starA_text = $starFev_text;
$starA_link = $starFev_link;
$starA_image = $starFev_image;
break;
}
$jour = date("j");
$mois = date("m");
//echo $mois;
//echo $jour;
/* STAR : Pour le BLOC A */
function blocA() {
switch ($mois) {
case 01 : $starA_title1 = $starJan_title1; $starA_title2 = $starJan_title2;
$starA_text = $starJan_text;
$starA_link = $starJan_link;
$starA_image = $starJan_image;
break;
case 02 : $starA_title1 = $starFev_title1;
$starA_title2 = $starFev_title2;
$starA_text = $starFev_text;
$starA_link = $starFev_link;
$starA_image = $starFev_image;
break;
}
miltonis a dit:Re,![]()
je reprends possession du topic pour trouver solution à ma question :
lorsque j'edite ce code, j'ai cette erreur :
2e tiers Star, bloc A
Notice: Undefined variable: mois in c:\program files\easyphp1-8\www\perou\star.php on line 18
Code:$jour = date("j"); $mois = date("m"); //echo $mois; //echo $jour; /* STAR : Pour le BLOC A */ function blocA() { switch ($mois) { case 01 : $starA_title1 = $starJan_title1; $starA_title2 = $starJan_title2; $starA_text = $starJan_text; $starA_link = $starJan_link; $starA_image = $starJan_image; break; case 02 : $starA_title1 = $starFev_title1; $starA_title2 = $starFev_title2; $starA_text = $starFev_text; $starA_link = $starFev_link; $starA_image = $starFev_image; break; }
ect-ce qu'il faut déclarer la variable à dans CHAQUE FOCNTION ?
j'ai essayé avec GLOBAL, pas de résultat staisfaisant.
Un pti coup de main si ou plé![]()
merci
➡️ Offre MyRankingMetrics ⬅️
pré-audit SEO gratuit avec RM Tech (+ avis d'expert)
coaching offert aux clients (avec Olivier Duffez ou Fabien Faceries)
Voir les détails ici