I’m new to php so please bear with me here.
Its a rough example but lets say I have a file (which obviously does’t work :), say 1.php, there I have
<?php
function links1($l1, $l2){echo "<a href='". $l1 ."'><img src='". $l2 ."'/></a>";}
$ext_file = '2.php';
$v1 = fopen($ext_file, 'r');
$data = fread($v1, filesize($ext_file));
//i assume some piece of code has to go here?? Or maybe i need a new approach ...
?>
where I’m trying to basically read 2.php where I have
links1("gg1", "1.jpg");
links1("gg2", "2.jpg");
etc...
so that when I open 1.php I would see 1.jpg 2.jpg etc etc… How to do that?
And if its possible, how should I modify the code that I could only put
gg1 1.jpg
gg2 2.jpg
gg3 3.jpg
gg4 4.jpg
....
and it would still work?
Thank you guys for help!
It is possible…
If your line end of line is set to Windows and not UNIX they use
"\r\n"…