phpserialize icon indicating copy to clipboard operation
phpserialize copied to clipboard

how can i delete struct name

Open mengdodo opened this issue 3 years ago • 1 comments

phpserialize.Marshal(&we, &phpserialize.MarshalOptions{OnlyStdClass:false})

O:10:"wechatData":12:{s:7:"errcode";i:0;s:6:"errmsg";……}

php serialize array

a:11:{s:7:"errcode";i:0;s:6:"errmsg";……}

how can i delete struct name wechatData

mengdodo avatar Mar 17 '21 10:03 mengdodo

Perhaps PHP did not include it because it was private? In any case you can ignore a property with tags:

type MyStruct struct {
	WeChat string `php:"-"`
}

elliotchance avatar Mar 17 '21 14:03 elliotchance