$input = "This & that"; $output = JFilterOutput::ampReplace($input); echo $output; // Output: This & that
$input = "© 2021"; $output = JFilterOutput::ampReplace($input); echo $output; // Output: © 2021In this example, the input string "© 2021" contains a copyright symbol which is preceded by an ampersand. The ampReplace method replaces this ampersand with & and produces the output "© 2021". The package library for JFilterOutput is part of the Joomla framework.