What is the function in PHP that can execute a string as code?

To execute a string as code in PHP, you can use the `eval()` function. This function takes a string as an argument and executes it as PHP code. However, it is important to use `eval()` with caution as it can introduce security risks if the input is not properly sanitized.

$code = "echo 'Hello, World!';";
eval($code);