T
T
TechNOIR2018-02-26 09:20:03
PHP
TechNOIR, 2018-02-26 09:20:03

PHP. Can an include script replace the result of a variable in the main script?

Good afternoon.
Tell me please. Can an include script replace the result of a variable in the main script?
I.e. On the simplest example:
Main script:

include 'inc.php'
$test = 'Как дела';
echo $test;

and in inc.php you need to process $test somehow and replace "How are you" with let's say "How are you"
Something like that ..:
if ($test === 'Как дела'){
$test = 'Как ты'
}

How to do it right?
Thanks in advance)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arman, 2018-02-26
@Arik

If in this order - no, if include is after the variable, then you can change it as usual

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question