Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Using variable outside of if statement

Posted on 2006-11-03
1
234 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

856 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