What is the equivalent function to file_put_contents in PHP 4?

In PHP 4, the equivalent function to file_put_contents is file_put_contents_compat. This function allows you to write data to a file in a similar way to file_put_contents in newer versions of PHP.

```php
function file_put_contents_compat($filename, $data) {
    $fp = fopen($filename, 'w');
    fwrite($fp, $data);
    fclose($fp);
}
```

You can use this function in PHP 4 to achieve the same functionality as file_put_contents in newer versions of PHP.