Using PHP, how can I add quotations to a non-standard INI file?
I'm having to work with a custom application that stores information in an INI formatted file. Unfortunately, it doesn't use double-quotes around all the values, so PHP's parse_ini_file function won't work. Is there some way to add quotations around ALL the values in the INI file so that the parse_ini_file would be able to parse it?
I figured out something that works for me! $lines = file_get_contents('bravo.txt'); $search = array("=", "\r\n"); $replace = array("=\"", "\" ");
Try this: $content = preg_replace('^([^=]+)=\s*(.*)$', '$1="$2"", $fileContent); This should make sure you are not falsely including whitespaces in your values.
Scheduled entity in onFlush is different instance
php, explode is not working, php preg_replace is not working
How to save expire sesion when I close browser
Contact Form 7 - Sum validation
Android: Retrieve details from MySQL database when a cardview is clicked
Create Dynamically 2D Array [closed]
Fetch random data from database without refreshing page
Error while uploading file to PHP and displaying it using fpdf
How can I sanitize custom CSS, without it breaking?
Symfony transform ChoiceType in CheckboxType
Display variable contents with drupal_set_message
Failed loading xdebug.so undefined symbol zend_sort
Memory exhausted at 1.6G even with ini_set('memory_limit', '-1')
how to get most popular articles from model and order desc
If statement with multiple condition checks not working properly
PHP Returning two different times