0
私は、jsonデータを出力するpoped mysqlデータベースを持っています。このデータは、angularjsを介して消費され表示されます。 、データベース内のテキスト文字列の一部のような引用符と二重引用符をエスケープしていますデータベース内のエスケープ文字を解決する最良の方法
Do you have at least a bachelor\'s degree in child development?
または
asking the children to address you as \"Ma\'am\" or \"Sir\" to formalize things
問題があるangularjsはまだエスケープ引用符で文字列を表示します。これを避ける最善の方法は何ですか?私は( "\「\)何か他のもののために検索を行うとエスケープ部分文字列を代入するデータベースに置き換えてください 出力はそれほどNG-モデルディレクティブと同じようにangularjsに表示されます?私は解決
...
<div class="bs form-group" ng-if="quiz.quizmanager.quiz.questions[quiz.activeQuestion].quiz_question_type === 'text'">
<input type="text" class="form-control" ng-model="quiz.quizmanager.quiz.questions[quiz.activeQuestion].answer"
ng-change="quiz.selectAnswer(0, quiz.quizmanager.quiz.questions[quiz.activeQuestion].quiz_question_type)"
/>
</div>
...
ええ、そういうクエリを実行できますか、データを出力する前に 'stripslashes'を使うことができます。あなたはそれを準備ステートメントにバインドする前にそれをエスケープしましたか? –
@ Don'tPanic配列にjson_encodingという文字列を指定すると、stripslashesは動作しませんでした。 。彼らは次のようになります: –
(70、 'Kickin \\\' Kitchens '、' Kickin \\\ 'Kitchens'、0,0、 '2017-07-06 00:00:00'、NULL、0、 00:20:00 ')、 –