shell - How to execute a php script from another php script? -
i have php files called file1.php, file2.php, file3.php. now, want run these php files 1 one other php file called all.php. mean file2.php executed after file1.php completed. file3.php executed after file2.php completed. how ?
can use exec function ? safe hosting ? using cpanel in shared hosting. there way safe content in hosting ?
thank !
you can use include()
include('file1.php'); include('file2.php'); include('file3.php');
include_once('file1.php'); include_once('file2.php'); include_once('file3.php');
or require or require_once
require 'file1.php'; require 'file2.php'; require 'file3.php';
=> require()
produce fatal error (e_compile_error) , stop script
=> include()
produce warning (e_warning) , script continue
Comments
Post a Comment