php-windows Digest 10 May 2008 07:19:51 -0000 Issue 3469

Topics (messages 28881 through 28884):

Re: Include Question!
        28881 by: awkenney.gmail.com
        28882 by: Bradley Stahl
        28883 by: Stut

Building PHP extension
        28884 by: Ambrish

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
What is it that you are trying to accomplish? Normally no if statement is 
needed for an include to take place unless a certain condition triggers the use 
of the include.
Sent via BlackBerry from T-Mobile

-----Original Message-----
From: Matthew Gonzales <[EMAIL PROTECTED]>

Date: Fri, 09 May 2008 13:49:07 
To:PHP-Windows Group <[EMAIL PROTECTED]>
Subject: [PHP-WIN] Include Question!

So I am really cornfused about the include function.

If I use the include function to make my code readable and neat where 
does the included code go. For instance:

if (some variable){
include(page.php);
}

Does the code go into the current page where the include statement is 
located on the page. Hope that makes sense.

Matt G

-- 
Matthew Gonzales
IT Professional Specialist
Enterprise Information Technology Services
University of Georgia
Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
Phone: (706)542-9538

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
Your code would essentially be "inserted" in the place where your include
statement is called.  Let's say that your in 'page.php' you had the
following code:

echo "I AM IN PAGE.PHP!";

and then in your script you have your code:

if (some variable) {
    include('page.php');
}


This would essentially be giving you the code:

if(some variable) {
    echo "I AM IN PAGE.PHP!";
}

I hope that this makes sense.. and this helps!

On Fri, May 9, 2008 at 1:49 PM, Matthew Gonzales <[EMAIL PROTECTED]> wrote:

> So I am really cornfused about the include function.
>
> If I use the include function to make my code readable and neat where does
> the included code go. For instance:
>
> if (some variable){
> include(page.php);
> }
>
> Does the code go into the current page where the include statement is
> located on the page. Hope that makes sense.
>
> Matt G
>
> --
> Matthew Gonzales
> IT Professional Specialist
> Enterprise Information Technology Services
> University of Georgia
> Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> Phone: (706)542-9538
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
On 9 May 2008, at 18:56, Bradley Stahl wrote:
Your code would essentially be "inserted" in the place where your include
statement is called.  Let's say that your in 'page.php' you had the
following code:

echo "I AM IN PAGE.PHP!";

and then in your script you have your code:

if (some variable) {
   include('page.php');
}


This would essentially be giving you the code:

if(some variable) {
   echo "I AM IN PAGE.PHP!";
}

I hope that this makes sense.. and this helps!

That's not quite right and I think it's important to understand exactly what PHP does here.

PHP is executing a file and encounters file inclusion (include/ require(_once)). PHP will load and compile the included file. During this stage it registers declarations in the global scope, i.e. classes and functions. After that it executes the included file in the same context from which it was included, so all local vars visible inside your if block will be accessible. Once that file's done PHP returns to executing the original file from the statement after the include.

Note that no code insertion takes place, it purely passes execution to the included file. It's this sequence that prevents you from defining a class across several files.

Hope that makes it clearer.

-Stut

--
http://stut.net/

On Fri, May 9, 2008 at 1:49 PM, Matthew Gonzales <[EMAIL PROTECTED]> wrote:

So I am really cornfused about the include function.

If I use the include function to make my code readable and neat where does
the included code go. For instance:

if (some variable){
include(page.php);
}

Does the code go into the current page where the include statement is
located on the page. Hope that makes sense.

Matt G

--
Matthew Gonzales
IT Professional Specialist
Enterprise Information Technology Services
University of Georgia
Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
Phone: (706)542-9538

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--- End Message ---
--- Begin Message ---
Hi All,

How Can I build any PHP extension standalone? I do not want to build it with
php source code. Is there a way to do it?
-- 
View this message in context: 
http://www.nabble.com/Building-PHP-extension-tp17160680p17160680.html
Sent from the Php - Windows mailing list archive at Nabble.com.


--- End Message ---

Reply via email to