How can mod_rewrite be used to hide variables in the URL in PHP?
To hide variables in the URL using mod_rewrite in PHP, you can rewrite the URLs to appear as if they are static pages while still passing the variables internally. This can improve the aesthetics of the URLs and enhance security by hiding sensitive information from users.
```php
RewriteEngine On
RewriteRule ^products/([0-9]+)/?$ product.php?id=$1 [NC,L]
```
In this example, the URL "example.com/products/123" will internally map to "example.com/product.php?id=123" without revealing the variable in the URL.