« strip_tags
stripos »

stripcslashes

(PHP 4, PHP 5, PHP 7, PHP 8)

stripcslashes — addcslashes() でクォートされた文字列をアンクォートする

説明

function stripcslashes(string $string): string

バックスラッシュを取り除いた文字列を返します。C言語と同様に \n, \r ..., 8進表現, 16進表現を認識します。

パラメータ

string

元に戻したい文字列。

戻り値

元に戻した文字列を返します。

例

例1 stripcslashes() の例

<?php

var_dump(stripcslashes('I\'d have a coffee.\nNot a problem.') === "I'd have a coffee.
Not a problem."); // true
?>

参考

  • addcslashes() - C 言語と同様にスラッシュで文字列をクォートする

関連キーワード:
stripcslashes   addcslashes   クォート   アンクォート   言語   表現   coffee   problem   strip   tags   stripos   バックスラッシュ   認識   dump   nNot   参考   スラッシュ
関連する関数・ページ:
function.addcslashes   function.addslashes   function.quotemeta   language.operators.execution   function.stripslashes   ref.strings