Jump to content

Reading/Writing PHP file with PHP?


DT-Ahmad

Recommended Posts

Hi,

 

I am still learning my way with this beautiful language, and I do have a couple of issues really and I was unable to find answers to them on Google.

 

Can I read a PHP file with PHP?

Basically. This is the short story; I want to read a language file in the browser. The language file say.. english.php and its content is like this:

 

<?php

DEFINE('HELLO_TEXT', 'Hello!');
DEFINE('LOGIN_TEXT', 'Log In');

?>

 

Now if I assume the above code presents a file called english.php

 

Is it possible to read/loop through values using PHP directly from the browser? I tried with fopen but I am just not sure if this is the correct way to read such file.

 

Any input is greatly appreciated guys

Link to comment
https://forums.phpfreaks.com/topic/149243-readingwriting-php-file-with-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.