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.
Yii2 dropdownlist WITHOUT $model
Joomla 3 user_usergroup_map table set a group_id=9 after registration
not getting user name and id from database in codeigniter
MySQL database insertion error
loop through column of a single row
Get Soap last response
Laravel: Route not found error
unable to receive all ios notifications in device using php apns push
Error in MySQL Syntax My First Project [closed]
Show only specific range of pages in pagination?
Select elements from array (?) (api)
PDO exceptions being affected by ATTR_EMULATE_PREPARES with PostgreSQL
Adding / grouping classes in php
How to select only 1 row from a query result? like the 4th row
PHP round() 0.50 to lower value
PHP SQL query id from table with multiple values in rows