Solved

Using variable outside of if statement

Posted on 2006-11-03
1
233 Views
Last Modified: 2006-11-18
Hi Experts,

I have just come back to PHP programming after a stint of doing vb.net. I am wondering if there is a way to continue a variable outside of an IF statement.

Would this require Register Globals switched on?

0
Comment
Question by:nickmarshall
1 Comment
 
LVL 49

Accepted Solution

by:
Roonaan earned 125 total points
ID: 17865008
No,

You can just use the variable outside the if statement. Scopes are defined by the global scope, classes and functions. If's and loop's do not define a scope of themselves in PHP.

-r-
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

822 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question