Strange behaviour of file_get_contents???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tores
Forum Contributor
Posts: 120
Joined: Fri Jun 18, 2004 3:04 am

Strange behaviour of file_get_contents???

Post by tores »

Hi

Can someone tell me why I can't dump the string returned by file_get_contents? All I get is the length of the string, not the contents

Code: Select all

$contents = file_get_contents("configuration.php");
var_dump($contents);
outputs

Code: Select all

string(1045) &quote;&quote;
regards tores
tores
Forum Contributor
Posts: 120
Joined: Fri Jun 18, 2004 3:04 am

Post by tores »

htmlspecialchars tok care of the output. I guess there was a problem outputting the php-tags in configuration.php

Code: Select all

var_dump(htmlspecialchars($contents));
regards tores
Post Reply