jeudi 12 avril 2018

PHP array values issue with two if statements [on hold]

I am using simple php code to parse a file. There are 2 IF statements.

  1. If statement is using preg_match and looks for certain pattern, there is match found
  2. I put in array X
  3. Now there is second If statement that is also using preg_match looking for some pattern, there is match found.
  4. I print values from second If statement in table, but I also want the values found in first if statement to be printed in the table as well. However, I do not see values from array X being printed instead it I see empty line.

When I do print_r for array x within first If statement I can clearly see array has all the values not sure why it does not get printed in my table which is created once there is match found in second if statement.

Anyone has any inputs. It seems I should be doing nested if but that is not working for me.

Aucun commentaire:

Enregistrer un commentaire