Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php $first_name = "<script>alert();</script>"; $middle_name = 'Robert'; $last_name = 'Smith'; $username = 'testusername1'; $email = "testemail@mail.com"; $password = 'banana1'; // Here goes your string which is an array of the above variables... $strings = array ($first_name, $middle_name, $last_name, $username, $email, $password); // Here goes the trick :) $strings = array_map('htmlspecialchars', $strings); echo $first_name;
Copy Clear