This function decodes a base64 encoded string (created using the buffer_base64_encode function) into a new buffer.
The buffer is created as a 1 byte aligned "grow" buffer.
NOTE It's important that you remove any dynamically created resources like this from memory when you no longer need them to prevent memory leaks, so when you are finished with the buffer that you have created you should free it up again using buffer_delete.
buffer_base64_decode(string);
Argument | Type | Description |
---|---|---|
string | String | The base64 encoded string to decode |
ini_open("Save.ini");
buff = buffer_base64_decode(ini_read_string("Save", "Slot1", ""));
ini_close();
The above code will open an INI file and then read a string from it into the buffer_base64_decode function. The function will return a buffer, which is stored in the variable buff, containing the data previously encoded and saved. The INI file is then closed.