在同一台服务器上的file_get_content,我不想获取php代码

I know that file_gets_content on a php file hosted on the same server return the text and the PHP code, but I dont want to have the PHP code how to do that ?

Ex :

<?php function getOneExp(){
$fp=file_get_contents("exp.txt");
$exp=  (explode(',',$fp));
shuffle($exp);
return str_replace(" ","-",utf8_decode(trim(ucfirst(strtolower($exp[0])))));
}
?>

SOME TEXT <? echo getOneExp() ?> ANOTHER TEXT

If I make a file gets content on this file I get the php too, because its on the same server, but I dont want to have the PHP,

Any ideas ?

Thanks

Using include is a much better solution but if you don't like it, here's an alternative for you.

You can use either cURL or file_get_contents() with the actual web url. For example, if your domain name is example.com and the file name is test.php, then you can use this inside another php file -

<?php
$output = file_get_contents("http://example.com/test.php");