+ 3

How to add some code in a.php file with b.php file?

how to add some array in $love variable with other php file. function love() { $love = array( 'heart' => 'heart.png' 'sex' => 'sex.png' # add more array with other php file ); return $love; }

31st Jan 2018, 8:16 AM
Hamid reza Shayanmehr
Hamid reza Shayanmehr - avatar
1 Answer
+ 1
Am not sure what you mean but you can use fopen("file. txt",w) //to open the file you want to write from and use file() to read it. Then you can use some string functions and/regex to get the text you want and store them as variables then finally insert into your array, always remember you are using an associative array you need and index key. When you are done with the file you are using remember to close using the function fclose("file. txt")
1st Feb 2018, 9:07 AM
Strange
Strange - avatar