0
我有textarea字段,用戶可以在其中編寫隨機文本。張貼後,我需要把這個文本到json變量通過php。php將文本轉換爲json變量
類似的東西,文字:
Lorem Ipsum is simply "dummy text" of the printing\typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
,且該文本必須轉換成有效的JSON變量。 ?任何幫助)
給您的預計結果的expample。 –
{「textarea」:「Lorem Ipsum is simply ....」}所有問題是,這個字符串必須是json有效 - 沒有雙引號,新行和其他任何非有效元素 –
所以你想刪除所有特殊字符? –