How to pass a value in two PHP documents

Source: Internet
Author: User
How to pass a value in two PHP documents
In the function of a PHP document to calculate an intermediate value, in the function of another PHP file to use this intermediate value, ask, how can I achieve this intermediate value between the different documents pass?

------Solution--------------------
What is the relationship between the two documents?

Commonly used are: Post/get/cookie/session ...... such as.
------Solution--------------------
An intermediate value is computed in function A of PHP document A, which is used in function B of another PHP file B.

Then there are: PHP document C
Include ' PHP document a ';
Include ' PHP document B ';

$v = function B (function A ());
------Solution--------------------
I'm not going to use the stupidest way.
Referencing a common function
When you use it, count it again.

------Solution--------------------
Use the session to secure some
------Solution--------------------
The question is, if the B document contains a document, is the global variable in the a document not the same as the global variable in the a document?
Yes, variables/functions can be accessed directly in B

Your situation can be directly with include, or with Session/cookie.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.