PHP / Reference / stripslashes()
개요
- stripslashes() 함수는 백슬래시를 제거할 때 사용됩니다. 주로 데이터베이스에서 가져온 데이터나 이스케이프 처리된 문자열을 원래 상태로 복원할 때 사용됩니다.
- PHP 4 이상에서 사용할 수 있습니다.
문법
stripslashes( string )
예제
<!doctype html> <html lang="ko"> <head> <meta charset="utf-8"> <title>PHP</title> <style> * { font-family: "Consolas", monospace; font-size: 24px; } </style> </head> <body> <p>\PHP → <?php echo stripslashes( "\PHP" ); ?></p> <p>\'PHP → <?php echo stripslashes( '\'PHP' ); ?></p> </body> </html>
참고
- 백슬래시를 추가하는 함수는 addslashes()입니다.