PHPの質問です。連想配列をその構造を保ったままでMySQLに保存したいと思っています。連想配列をserialize()を使って変換したのですが、そのままMySQLに書き込もうとすると書き込めません。おそらく変換した文字列に「"」「;」などの記号が含まれているためで、それをhtmlspecialchars()で変換するとMySQLに書き込めるのですが、そうすると今度はunserialize()で復元できません。基本的なところだと思うのですが、こういうときはどうすれば良いかどなたか教えてください。