How to prevent Browser cache for PHP sites?

Try this:

header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

Redirect and prevent browser cache:

/**
 * Redirect (Prevent Browser cache)
 *
 * @param $url
 * @param int $code
 */
function headerLocation($url, $code = 301)
{
	header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
	header("Cache-Control: post-check=0, pre-check=0", false);
	header("Pragma: no-cache");
	header("Location: " . $url, true, $code);
	exit();
}