I've got a PHP files where inside i've got this line:
source: "<?php echo $this->row->cdkey;?>"
that returns a number like 124982149
I need to pass this into a php variable
But if i try:
$variable = '<?php echo $this->row->cdkey;?>';
it doesn't retun anything.
How can i solve this without connecting to mysql?
if you can change code in php file like below
return $this->row->cdkey;
Call it where you want
$fileContent = file_get_contents($filePath);
$variable = eval($fileContent);
if you can not change code in php file than you just use CURL link
You are using php
to save this to a variable, like this.
$variable = $this->row->cdkey;
There is no need to open and close php
tag inside another php tag, Then simply echo or print $variable
anywhere to get $this->row->cdkey
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.