I need an array in multiple pages, so I tried to make a php file where the array is printed. I used:
file_put_contents('file.php',
'<?php $order = ' . var_export($order1, true) . '; ?>');
I was hoping that if I included this file in the files where I need the array, I could use it as $order
, but I get an error instead.
I checked file.php
and everything looks in order.
Does anyone knows what I am doing wrong?