Hi there,
I've a php script in certain file called a.php, contains php script:
<?
$variable1 = 'hello world';
?>
Now I have a php class in other file named b.php, and I want to access the $variable1 into a method in this class
how can I do this?
thanks
Include php script into php class
Moderator: General Moderators
Re: Include php script into php class
It should work using this:mellice wrote:Hi there,
I've a php script in certain file called a.php, contains php script:
<?
$variable1 = 'hello world';
?>
Now I have a php class in other file named b.php, and I want to access the $variable1 into a method in this class
how can I do this?
thanks
Code: Select all
<?php
include("b.php");
$variable1 = 'hello world';
?>Code: Select all
<?php
include("a.php");
//your b file coding
?>