Parsing Valve Data Format files in PHP

后端 未结 2 1255
暗喜
暗喜 2021-01-23 14:45

I am completely stuck in how to start parsing these kind of files in PHP. These are some sort of arrays with variable amount of sub-arrays. https://developer.valvesoftware.com/w

2条回答
  •  时光取名叫无心
    2021-01-23 15:19

    Late answer, but just saw this. The data on question is in (Valve Data Format)[https://developer.valvesoftware.com/wiki/KeyValues], also called KeyValues format, and is very reminiscence of JSON.

    About a year ago I wrote this script which can convert VDF data to valid JSON. You can use it once and store the generated JSON or call it anytime you need JSON from VDF.

    https://gist.github.com/AlienHoboken/5571903

提交回复
热议问题