How can mod_rewrite be utilized in PHP to separate website content into different directories or subdomains without copying files?

Mod_rewrite can be utilized in PHP to separate website content into different directories or subdomains without physically copying the files by using rewrite rules in the .htaccess file. This allows for a cleaner URL structure and better organization of website content.

```php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/(.*)$ index.php?subdomain=$1&path=$2 [L]
```
This code snippet sets up mod_rewrite rules to redirect requests to index.php with the subdomain and path as parameters, allowing for dynamic handling of different directories or subdomains within the same PHP script.