Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > fr.comp.lang.php > #3179

Re: $variable++ qui ne marche pas?

From Otomatic <otomatic@oto.invalid>
Newsgroups fr.comp.lang.php
Subject Re: $variable++ qui ne marche pas?
Date 2019-12-10 17:59 +0100
Organization PCatHome&Me
Message-ID <lfivue9jiodfeqlddk7m7fpi40nkp39kus@4ax.com> (permalink)
References <5def03f3$0$3860$426a34cc@news.free.fr> <qsns4e$2a52$1@cabale.usenet-fr.net> <5def7e1e$0$3874$426a74cc@news.free.fr>

Show all headers | View raw


jp <bloiiing@yahoo.invalid> écrivait :

> $counter = $counter + 1;//C'est ici que $counter++ ne fonctionne pas...
Avertissement :
Notice: A non well formed numeric value encountered in
E:\wamp\www\counter.php on line 19

Si le fichier contient un caractère de fin de ligne :
00000000h: 32 31 38 0A                                     ; 218.

Donc, c'est bien ce que je subodorais dans mon message précédent :
$counter n'est pas numérique mais une chaîne de caractères.

On peut forcer le type en numérique entier par :
$counter = (int)fgets($fp, 20);

et là, $counter++; ne pose plus de problème.

Back to fr.comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

$variable++ qui ne marche pas? jp <bloiiing@yahoo.invalid> - 2019-12-10 02:33 +0000
  Re: $variable++ qui ne marche pas? Eric Demeester <neuneu@potiron.invalid> - 2019-12-10 09:45 +0100
    Re: $variable++ qui ne marche pas? jp <bloiiing@yahoo.invalid> - 2019-12-10 09:49 +0000
      Re: $variable++ qui ne marche pas? Otomatic <otomatic@oto.invalid> - 2019-12-10 11:24 +0100
        Re: $variable++ qui ne marche pas? Olivier Miakinen <om+news@miakinen.net> - 2019-12-10 11:31 +0100
          Re: $variable++ qui ne marche pas? jp <bloiiing@yahoo.invalid> - 2019-12-10 11:15 +0000
          Re: $variable++ qui ne marche pas? Otomatic <otomatic@oto.invalid> - 2019-12-10 17:20 +0100
        Re: $variable++ qui ne marche pas? jp <bloiiing@yahoo.invalid> - 2019-12-10 11:16 +0000
  Re: $variable++ qui ne marche pas? Otomatic <otomatic@oto.invalid> - 2019-12-10 10:07 +0100
  Re: $variable++ qui ne marche pas? Olivier Miakinen <om+news@miakinen.net> - 2019-12-10 11:30 +0100
    Re: $variable++ qui ne marche pas? jp <bloiiing@yahoo.invalid> - 2019-12-10 11:14 +0000
      Re: $variable++ qui ne marche pas? Didier <nospam@invalid.fr> - 2019-12-10 14:58 +0100
        Re: $variable++ qui ne marche pas? jp <bloiiing@yahoo.invalid> - 2019-12-10 14:23 +0000
      Re: $variable++ qui ne marche pas? Otomatic <otomatic@oto.invalid> - 2019-12-10 16:17 +0100
        Re: $variable++ qui ne marche pas? jp <bloiiing@yahoo.invalid> - 2019-12-12 14:24 +0000
      Re: $variable++ qui ne marche pas? Denis Beauregard <denis.b-at-francogene.com.invalid@nospam.com.invalid> - 2019-12-10 11:32 -0500
      Re: $variable++ qui ne marche pas? Otomatic <otomatic@oto.invalid> - 2019-12-10 17:59 +0100
        Re: $variable++ qui ne marche pas? Olivier Miakinen <om+news@miakinen.net> - 2019-12-10 19:53 +0100
          Re: $variable++ qui ne marche pas? Eric Demeester <neuneu@potiron.invalid> - 2019-12-11 09:40 +0100
            Re: $variable++ qui ne marche pas? Otomatic <otomatic@oto.invalid> - 2019-12-11 10:17 +0100

csiph-web