<?php
$file = fopen("configuration.conf","w+");
$settings['LogEnabled'] = "true";
$settings['Pass'] = "pass";
$settings['ShowWarning'] = "true";
fwrite($file,serialize($settings));
$path = "configuration.conf";
$file2 = file_get_contents($path);
$settings2=unserialize($file2);
echo($settings2['LogsEnabled']);
?>
It ought to show "true" when run. Whats wrong?
I tried fread and fopen for $file2, but neither work.
EDIT: It does not throw an error.
The file has permissions 0740
Not sure if it matters, but you have 'LogEnabled' in the serialize section and 'Log s Enabled' in the unserialize section.
Could that 's' be throwing you off?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.