Tagged articles
4 articles
Page 1 of 1
php Courses
php Courses
Dec 15, 2023 · Backend Development

Using PHP htmlspecialchars() to Escape Special Characters

This article explains the PHP htmlspecialchars() function, its syntax and parameters, demonstrates how to escape special characters, quotes, and specify encoding or disable double‑encoding, and shows how it helps prevent XSS attacks in web applications.

BackendPHPXSS
0 likes · 4 min read
Using PHP htmlspecialchars() to Escape Special Characters
php Courses
php Courses
Sep 16, 2023 · Information Security

How to Use PHP htmlspecialchars() to Escape Special Characters and Prevent XSS

This article explains the purpose, syntax, optional parameters, and practical examples of PHP's htmlspecialchars() function, demonstrating how to safely convert special characters to HTML entities, control encoding and flags, avoid double‑encoding, and follow important usage considerations for secure web development.

PHPWeb SecurityXSS
0 likes · 6 min read
How to Use PHP htmlspecialchars() to Escape Special Characters and Prevent XSS
Laravel Tech Community
Laravel Tech Community
Apr 5, 2022 · Information Security

Preventing XSS Attacks in PHP: Best Practices and Code Examples

This article explains various methods to prevent XSS injection in PHP, covering the limitations of built‑in filters, proper use of htmlspecialchars and htmlentities, replacement techniques, and provides comprehensive PHP functions with code examples for sanitizing user input and removing malicious scripts.

Code ExamplePHPWeb Security
0 likes · 7 min read
Preventing XSS Attacks in PHP: Best Practices and Code Examples