PHP Classes

File: phpcf-src/test/expected/heredoc.php

Recommend this page to a friend!
  Classes of Alex Krash   PHP Code formatter   phpcf-src/test/expected/heredoc.php   Download  
File: phpcf-src/test/expected/heredoc.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: PHP Code formatter
Reformat PHP code according to standard options
Author: By
Last change:
Date: 9 years ago
Size: 944 bytes
 

Contents

Class file image Download
<?php
function dieWithFallback(array $urls)
{
   
$url = $urls['url'];

   
$fallbackURL = $urls['fallback_url'];

    print <<<EOF
<!doctype html>
<html>
<head>
<title></title>
<script>
    var fallbackUrl = '
$fallbackURL';
    if (navigator.platform && navigator.platform.match(/(iPad|iPhone|iPod)/g)) {
        setTimeout(function() {
            var onPageHide = function() {
                clearTimeout(id);
                window.removeEventListener('pagehide', onPageHide);
            };
            window.addEventListener('pagehide', onPageHide);
            window.location.href = '
$url';
            var id = window.setTimeout(function() {
                window.location.href = fallbackUrl;
            }, 3500);
        }, 0);
    } else {
        window.location.href = fallbackUrl;
    }
</script>
<noscript><META http-equiv="refresh" content="0;URL=
$fallbackURL"></noscript>
</head>
<body></body>
</html>
EOF;

    exit(
0);
}