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.
Submitting the same value many times when the value needs to be unique
'Order by' specified order in Woocommerce shortcode
woocommerce hooks warning “function not found”
How to acces value from route in symfony2
Get Value Of Table Field
redirecting a long URL to https
How to embed this php code in html?
Uncaught Error: Call to undefined function curl_init()
Multi level login by address
SELECT * FROM table WHERE `id` in … and where sum() less
Laravel: Undefined method fake on Laravel storage facades for file upload testing
Very Complex SQL Data Result Merge via PHP (Multi Dimentional Arrays)
codeigniter Insert_batch not working
How do I fix this invalid JSON that wasn't escaped? (in PHP)
PHP: how to adding date with number of month from database? [duplicate]
Illegal string offset 'class' in ( php 7.1.1 ) [duplicate]