How can conflicts between Content-Security-Policy and X-Content-Security-Policy headers be resolved in PHP to ensure proper functionality?

Conflicts between Content-Security-Policy and X-Content-Security-Policy headers can be resolved by setting the Content-Security-Policy header in PHP with both directives combined. This ensures that the browser follows the directives specified in both headers.

header("Content-Security-Policy: default-src 'self'; script-src 'self' https://example.com; style-src 'self' https://example.com; img-src 'self' data:;");