summaryrefslogtreecommitdiff
path: root/utils.php
blob: 60dd29a1fed7b551d4e7e063df487c7c1ceb074e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php 


function echoln($content){
    if($content === true){
        $content = "true";
    }
    if($content === false){
        $content = "false";
    }
    echo $content; 
    echo "<br/>";
}

function println($content) 
{
    print_r($content);
    echo "<br/>";
}

// 替换为html转义字符,否则插入sql会有问题
function html_escape_string($str) {
    $str = str_replace("'", "&apos;", $str); // '
    $str = str_replace('"', "&quot;", $str); // "
    return $str;
}

function redirect($url){
    header('Location: '.$url);
}

?>