storing strings in ini with newlines

RizbIT

Member
[User]
recordlogs="
13/03/2021 - 565
13/03/2021 - 633
13/03/2021 - 574
13/03/2021 - 700 "

You can write a string to ini that has \n new line escape character

BUT

When you try to read in the value of recordlogs you get a blank string as opposed to all the string
 

RizbIT

Member
Not really, ive seen the value the ini_read_string returns its just the first line, which in this case is blank
 

FrostyCat

Redemption Seeker
If you will be saving strings that contain newlines and other INI-reserved characters, I think you've outgrown the format. The built-in INI functions have never handled them cleanly, and they probably never will. On the other hand, JSON will never give you this nonsense, and that is also why you should learn how to use that instead.
 
Top