If anyone is wondering how to do it in .net - here's basically how I did it....
This formats the .net name-value-pair arrays into the php formatting for base64 encoding.
NameValueCollection httpParam = new NameValueCollection();
Dictionary<string, string> configOption = new Dictionary<string, string>();
configOption.Add(strAddonId, strAddonOptionId);
byte[] bytes = Encoding.UTF8.GetBytes(phpStringArray(configOption));
string base64String = Convert.ToBase64String(bytes);
httpParam.Add("configoptions", base64String);
public static string phpStringArray(Dictionary<string, string> arr)
{
StringBuilder sb = new StringBuilder("a:")
.Append(arr.Count).Append(":{");
foreach (string key in arr.Keys)
{
sb.AppendFormat("s:{0}:\"{1}\";s:{2}:\"{3}\";",
key.Length, key, arr[key].Length, arr[key]);
}
return sb.Append('}').ToString();
}