How to pass variables between php scripts?

前端 未结 7 1969
梦如初夏
梦如初夏 2020-12-03 15:15

Is there any way to pass values and variables between php scripts?

Formally, I tried to code a login page and when user enter wrong input first another script will

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-03 15:38

    I use extract() method to pass variable among PHP Scripts. It look like below example:

    1. File index.php

    'hello',
        'content'=>'hello world'
    ];
    extract($data);
    require 'content.php';
    

    2. File content.php :

提交回复
热议问题