How can mod_rewrite be used to create more user-friendly URLs in PHP?

Mod_rewrite can be used in PHP to create more user-friendly URLs by rewriting URLs in a way that hides the underlying server-side script file names and parameters. This can make URLs easier to read and remember for users, as well as improve search engine optimization.

```php
RewriteEngine On
RewriteRule ^products/([0-9]+)/?$ product.php?id=$1 [NC,L]
```

In this example, the mod_rewrite rule rewrites a URL like "example.com/products/123" to "example.com/product.php?id=123". This allows for a more user-friendly URL structure while still directing the request to the appropriate server-side script.