[SOLVED] Php Code form php7.3 to 8 doesn't work anymore

Ask your questions here.
Post Reply
wiltur
Posts: 37
Joined: 22 Sep 2022, 15:18
Name: Wil Tur
Location: France

[SOLVED] Php Code form php7.3 to 8 doesn't work anymore

Post by wiltur »

Hi all,

I've big big trouble, this php code doesn't work anymore since I upgraded to 3.5 (and php 7.3 to php 8)

It should return a pattern (such as "2401C125") but it always return "0"

I think it's a difference between php 7.3 and 8, but I can't see what's wrong.

Please, tell me something good, I'm in big trouble now...

Code: Select all

$datecrea = gmdate("Ym", [date_added]);;
$minute = date("his");
$debut = substr($datecrea,-4,4);
$initiale = chr(65+[created_by]);
$compt = [id] % 999;
$compteur=str_pad($compt, 3, "0", STR_PAD_LEFT); 
$code_import = [302];
$code = [293];

$id_utilisateur = $app_user['id']; # Identifiant de 'lutilisateur courant
$initiale = chr(64+ $id_utilisateur); # l'initiale associèe à l'utilisateur courant

if ($code_import<>'')
  $output_value = $code_import;
	else
      if (empty($code))
  		$output_value = $debut. 'N' .$compteur;
Last edited by wiltur on 01 Feb 2024, 21:52, edited 1 time in total.
Eric
Posts: 181
Joined: 25 Jun 2020, 13:40
Name: Eric Henrich
Location: Germany

Re: Php Code form php7.3 to 8 doesn't work anymore

Post by Eric »

I can't test your code, but I see $datecrea = gmdate(\"Ym\", [date_added]);; where ;; is one ; too much.
wiltur
Posts: 37
Joined: 22 Sep 2022, 15:18
Name: Wil Tur
Location: France

Re: Php Code form php7.3 to 8 doesn't work anymore

Post by wiltur »

well, it doesn't change anything, but thank you :)
wiltur
Posts: 37
Joined: 22 Sep 2022, 15:18
Name: Wil Tur
Location: France

Re: Php Code form php7.3 to 8 doesn't work anymore

Post by wiltur »

Got it, I changed

Code: Select all

($code_import<>'')
with

Code: Select all

($code_import =='')
It works now.
Post Reply