php - How to parse_ini_file from web page -
php - How to parse_ini_file from web page -
this question has reply here:
php parse_ini_file work on url? 2 answersi trying parse ini file hosted on web server little no luck. can parse if have test ini file locally, no such luck if seek contact remote server.
here code have been working night.
<?php $datas = parse_ini_file( http://example.com/test.ini, true ); ?> <table border="1" cellspacing="0" cellpadding="5"> <tbody> <?php foreach( $datas $data ) { ?> <tr> <td rowspan="2"><?php echo htmlspecialchars( $data["name"] ); ?></td> <td>name</td> <td>points</td> </tr> <tr> <td><?php echo htmlspecialchars( $data["name"] ); ?></td> <td><?php echo htmlspecialchars( $data["points"] ); ?></td> </td> </tr> <?php } ?> </tbody> </table>
try instead:
parse_ini_string(file_get_contents('http://example.com/test.ini'), true);
i'm confident parse_ini_file doesn't back upwards http stream wrapper.
php file parsing table ini
Comments
Post a Comment