Extract variables from php file from function in another file
P粉198670603
P粉198670603 2023-09-07 13:33:37
0
1
464

I have a php file in the root directory and I want to retrieve a variable from a function in another php file. I need it for SQL queries.

My php file is in the root directory

getValue(' SELECT MIN(`price`) FROM `' . _DB_PREFIX_ . 'product_attribute` WHERE `id_product` = ' . (int)$id_product );

I need to get $id_product from another file that is required and is inside a function and uses the parameters of that function.


      

I know there is an easy way to do this, but I've been searching for hours and can't find it, can you guys help me?

P粉198670603
P粉198670603

reply all (1)
P粉256487077

Use

in the root directory
require_once(''); $id_product = hookDisplayPriceBlock(); .....

File 2

public function hookDisplayPriceBlock($param) { ... return $id_product; }
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!