How to access my variables outside the if loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to access my variables outside the if loop

Php variables

22nd May 2022, 3:05 PM
Reza
Reza - avatar
1 Answer
+ 2
Do you mean a variable you create within a loop and you want to use that same variable once the loop has finished? That's not possible because the variable is only exists within the loop. Once the loop ceases to exist, so does the variable.
22nd May 2022, 3:13 PM
Justice
Justice - avatar