
get_magic_quotes_runtime() 함수는 PHP 5.3.0부터 deprecated되었으며, PHP 7.4.0부터는 삭제되었습니다.
이 함수는 PHP 5.3.0 이전 버전에서만 사용할 수 있습니다.
magic_quotes_runtime 옵션이 활성화되어 있는지 비활성화되어 있는지 확인하려면, PHP 5.3.0 이전 버전에서만 사용할 수 있는 이 함수를 사용할 수 있습니다.
magic_quotes_runtime 옵션이 활성화되어 있으면, 이 함수는 1을 반환하고, 비활성화되어 있으면 0을 반환합니다.
예시 코드는 다음과 같습니다.
#hostingforum.kr
php
<?php
// magic_quotes_runtime 옵션이 활성화되어 있는 경우
ini_set('magic_quotes_runtime', 1);
echo get_magic_quotes_runtime(); // 1
// magic_quotes_runtime 옵션이 비활성화되어 있는 경우
ini_set('magic_quotes_runtime', 0);
echo get_magic_quotes_runtime(); // 0
?>
PHP 5.3.0 이후 버전에서 magic_quotes_runtime 옵션을 사용하려면, PHP 5.3.0 이후 버전에서 제공하는 다른 방법을 사용해야 합니다.
예를 들어, PHP 5.3.0 이후 버전에서는 addslashes() 함수를 사용하여 문자열을 자동으로 슬래시로 감싸는 것을 수행할 수 있습니다.
#hostingforum.kr
php
<?php
$str = "Hello, World!";
$str = addslashes($str);
echo $str; // Hello, World!
?>
2025-06-24 04:37