Copy code The code is as follows: $search = array ("' ]*?>.*?'si", // Remove javascript "']*?>.*?'si", // Remove css "'<[/!]*?[^<>]*?>'si", // Remove HTML tags "'