Is there a way to reference a variable from an external document with PHP? -
I want to use PHP, but I need to know how to get a variable from an external document ( External.php) and use it in a function in a PHP document (internal.php). I was thinking something like this:
Code for external code
$ variable = "true";
internal.php for code
if ($ GETFROM {'/ external.php'} ['variable']) "This worked" Echo;
Is it possible to do something like this?
If you want to include a specific value directly from an innerfile file in your current document, you You can also include the PHP file that gives value.
For example:
inc.php
& lt ;? Php returns "Hello, world!"; ? & Gt;
index.php
& lt; Php $ var = Include "inc.php"; If (isset ($ var) & empty ($ var)) {echo "this worked! \ N"; Echo "value: {$ var}"; } And {echo "this failed!"; }? & Gt;
Comments
Post a Comment