Function within function in PHP?

It works, but the scope of test2() is limited. For example, this works: wally@zf ~$ cat y. Php wally@zf ~$ php -f y.

Php 123wally@zf ~$.

Wallyk thank you for the insight, this indeed works now. Can you explain why you require x to be redeclared once again as a global in the second function? – chicane Dec 4 '09 at 1:45 It's so that $x can be seen outside the respective functions.

If $x=123 were set outside test1(), there would be no need for test1() to have global $x. – wallyk Dec 4 '09 at 1:53.

I'm having trouble picturing a use-case for this.

You're not calling the function test2 so there's no reason for it to echo $x. Besides, you should construct the function outside, there's no added value in this case.

Return ($value); //stops execution of the function and returns its argument as the value at the point where the function was called. One may have more than one return()statements in a function. Print("This Line is not Bold.

Print("This Line is not Italics.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions