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.
Button wont open mailto:address based off of dropdown from mySQL database
fatal error in php and mysql
how to get video id or url after uploading with youtube data v3 php
How do `intval()` and `(int)` handle whitespace?
pagination not working with where condition
Custom post category query
php json read file
Dynamically setting class attribute to a symfony2 choice list generated from an entity in FormBuilder
Transfer RFID tag no. to mysql
How To Set Up Multiple WordPress Sites on a Single Ubuntu Instance with an Nginx VPS
Class 'GlobalSetting' not found in ( sfPropelRoute.class.php )
Palpal Mass Payment Responce
How to display selected textarea value in html
SSO Login without Page refresh
ZF2 - MySQL Regex for Whole word searches
Convert date stored as VARCHAR in MYSQL to MYSQL Compatible Date [duplicate]