当前位置: 首页>>代码示例>>PHP>>正文


PHP change函数代码示例

本文整理汇总了PHP中change函数的典型用法代码示例。如果您正苦于以下问题:PHP change函数的具体用法?PHP change怎么用?PHP change使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了change函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _moduleContent

function _moduleContent(&$smarty, $module_name)
{
    //global variables
    global $arrConf;
    //folder path for custom templates
    $local_templates_dir = getWebDirModule($module_name);
    //conexion resource
    //$str_conn = "sqlite3:////var/www/db/iptables.db";
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    //actions
    $accion = getAction();
    switch ($accion) {
        case "new":
            $content = newRules($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, array());
            break;
        case "desactivate":
            $content = desactivateFirewall($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case "save":
            $content = saveRules($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case "getPorts":
            $content = getPorts($pDB);
            break;
        case "change":
            $content = change($pDB);
            break;
        case "changeOtherPage":
            $content = changeOtherPage($pDB, $module_name);
            break;
        case "exec":
            $content = execRules($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case "delete":
            $content = deleteFilter($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        default:
            $content = reportRules($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
    }
    return $content;
}
开发者ID:netconstructor,项目名称:elastix-mt-gui,代码行数:42,代码来源:index.php

示例2: date

 $timed = date('Y-m-d H:i:n', $timed);
 if ($usenum == 1) {
     $sql = "UPDATE xuliehao SET fristtime = '{$timed}' , lasttime = '{$timed}' \r\n\t\t\t  WHERE id = '{$id}'";
     $result = MYSQL_QUERY($sql);
 }
 if ($usenum > 1) {
     $sql = "UPDATE xuliehao SET secondtime = '{$timed}' , lasttime = '{$timed}' \r\n\t\t\t  WHERE id = '{$id}'";
     $result = MYSQL_QUERY($sql);
 }
 $numten = $xuliehao1 . $xuliehao2;
 $anzhuangnums1 = $anzhuangnum1 . $anzhuangnum2;
 $anzhuangnums2 = $anzhuangnum3 . $anzhuangnum4;
 $lTestV[0] = change($numten);
 $lTestV[1] = change($miyao);
 $key[0] = change($anzhuangnums1);
 $key[1] = change($anzhuangnums2);
 $key[2] = 2563761818.0;
 $key[3] = 1374324473;
 $delta = 2654435769.0;
 $y = $lTestV[0];
 $z = $lTestV[1];
 $sum = 0;
 $a = $key[0];
 $b = $key[1];
 $c = $key[2];
 $d = $key[3];
 $temp1 = 0;
 $temp2 = 0;
 for ($i = 0; $i < 32; $i++) {
     $sum += $delta;
     if ($sum > 4294967296.0) {
开发者ID:rolandx,项目名称:dict,代码行数:31,代码来源:jihuosave.php

示例3: site

     site($_GET);
     break;
 case isset($_GET['sortindex']):
     sortItem($_GET);
     break;
 case isset($_GET['delid']) && !empty($_COOKIE[md5("role")]):
     delete($_GET);
     break;
 case (isset($_GET['deldoc']) || isset($_GET['item'])) && !empty($_COOKIE[md5("role")]):
     deleteDoc($_GET);
     break;
 case isset($_GET['chgdoc']) || isset($_POST['chgdoc']):
     changeDoc($_POST, $_GET);
     break;
 case isset($_GET['chid']) || isset($_POST['chid']):
     change($_POST, $_GET, $_FILES);
     break;
 case isset($_GET['ins']) || isset($_POST['ins']):
     insert($_GET, $_POST, $_FILES);
     break;
 case isset($_GET['users']) || isset($_POST['users']):
     users($_GET, $_POST);
     break;
 case isset($_GET['delusr']) && !empty($_COOKIE[md5("role")]):
     deleteUsr($_GET);
     break;
 case isset($_GET['chgusr']) || isset($_POST['chgusr']):
     changeUsr($_POST, $_GET);
     break;
 case isset($_GET['admin']):
     admin();
开发者ID:qlsove,项目名称:old.faq,代码行数:31,代码来源:info_controller.php

示例4: change

<?php

require "config/config.php";
require "model/change_model.php";
if ($_GET['id'] != null and is_numeric($_GET['id'])) {
    if (!empty($_POST)) {
        if ($_POST['prompt'] == "save") {
            change($conn, $_POST['omschrijving'], $_GET['id']);
        }
        header("Location: index.php");
    }
    $omschrijving = read($conn, $_GET['id']);
    require "view/header.php";
    require "view/change.php";
    require "view/footer.php";
} else {
    header("Location: index.php");
}
开发者ID:MNO-DAVINCI,项目名称:Todo-15A2,代码行数:18,代码来源:change.php

示例5: variabilityOfAssociationProfiles

function variabilityOfAssociationProfiles($filename, $series, $keywordToTrack, $ap)
{
    if (empty($series) || empty($keywordToTrack)) {
        die('not enough data');
    }
    $filename = get_filename_for_export("hashtagVariability", "_variabilityOfAssociationProfiles", "gexf");
    // group per slice
    // per keyword
    // 	get associated words (depth 1) per slice
    // 	get frequency, degree, ap variation (calculated on cooc frequency), words in, words out, ap keywords
    $degree = array();
    foreach ($series as $time => $cw) {
        $cw = $cw->getCowords();
        foreach ($cw as $word => $cowords) {
            foreach ($cowords as $coword => $frequency) {
                // save how many time slices the word appears
                $words[$word][$time] = 1;
                $words[$coword][$time] = 1;
                // keep track of degree per word per time slice
                if (array_key_exists($word, $degree) === false) {
                    $degree[$word] = array();
                }
                if (array_key_exists($coword, $degree) === false) {
                    $degree[$coword] = array();
                }
                if (array_key_exists($time, $degree[$word]) === false) {
                    $degree[$word][$time] = 0;
                }
                if (array_key_exists($time, $degree[$coword]) === false) {
                    $degree[$coword][$time] = 0;
                }
                $degree[$word][$time]++;
                $degree[$coword][$time]++;
            }
        }
    }
    // count nr of time slices the words appears in
    foreach ($words as $word => $times) {
        $documentsPerWords[$word] = count($times);
    }
    // calculate similarity and changes
    foreach ($ap as $word => $times) {
        $times_keys = array_keys($times);
        for ($i = 1; $i < count($times_keys); $i++) {
            $im1 = $i - 1;
            $v1 = $times[$times_keys[$im1]];
            $v2 = $times[$times_keys[$i]];
            $cos_sim[$word][$times_keys[$i]] = cosineSimilarity($v1, $v2);
            $change_out[$word][$times_keys[$i]] = change($v1, $v2);
            $change_in[$word][$times_keys[$i]] = change($v2, $v1);
            $stable[$word][$times_keys[$i]] = array_intersect(array_keys($v1), array_keys($v2));
        }
    }
    // @todo, frequency
    $out = "key\ttime\tdegree\tsimilarity\tassociational profile\tchange in\tchange out\tstable\n";
    foreach ($ap as $word => $times) {
        foreach ($times as $time => $profile) {
            if (isset($change_in[$word][$time])) {
                $inc = "";
                foreach ($change_in[$word][$time] as $w => $c) {
                    $inc .= "{$w} ({$c}), ";
                }
                $inc = substr($inc, 0, -2);
            } else {
                $inc = "";
            }
            if (isset($change_out[$word][$time])) {
                $outc = "";
                foreach ($change_out[$word][$time] as $w => $c) {
                    $outc .= "{$w} ({$c}), ";
                }
                $outc = substr($outc, 0, -2);
            } else {
                $outc = "";
            }
            if (isset($stable[$word][$time])) {
                $stablec = array();
                foreach ($stable[$word][$time] as $w) {
                    $stablec[] = $w;
                }
                $stablec = implode(", ", $stablec);
            } else {
                $stablec = "";
            }
            $prof = "";
            foreach ($profile as $w => $c) {
                $prof .= "{$w} ({$c}), ";
            }
            $prof = substr($prof, 0, -2);
            if (isset($degree[$word][$time])) {
                $deg = $degree[$word][$time];
            } else {
                $deg = "";
            }
            if (isset($cos_sim[$word][$time])) {
                $cs = $cos_sim[$word][$time];
            } else {
                $cs = "";
            }
            $out .= $word . "\t" . $time . "\t" . $deg . "\t" . $cs . "\t" . $prof . "\t" . $inc . "\t" . $outc . "\t" . $stablec . "\n";
//.........这里部分代码省略.........
开发者ID:jlorberkasunic,项目名称:dmi-tcat,代码行数:101,代码来源:mod.hashtag_variability.php

示例6: _moduleContent

function _moduleContent(&$smarty, $module_name)
{
    //include module files
    include_once "modules/{$module_name}/configs/default.conf.php";
    include_once "modules/{$module_name}/libs/paloSantoRules.class.php";
    //include file language agree to elastix configuration
    //if file language not exists, then include language by default (en)
    $lang = get_language();
    $base_dir = dirname($_SERVER['SCRIPT_FILENAME']);
    $lang_file = "modules/{$module_name}/lang/{$lang}.lang";
    if (file_exists("{$base_dir}/{$lang_file}")) {
        include_once "{$lang_file}";
    } else {
        include_once "modules/{$module_name}/lang/en.lang";
    }
    //global variables
    global $arrConf;
    global $arrConfModule;
    global $arrLang;
    global $arrLangModule;
    $arrConf = array_merge($arrConf, $arrConfModule);
    $arrLang = array_merge($arrLang, $arrLangModule);
    //folder path for custom templates
    $templates_dir = isset($arrConf['templates_dir']) ? $arrConf['templates_dir'] : 'themes';
    $local_templates_dir = "{$base_dir}/modules/{$module_name}/" . $templates_dir . '/' . $arrConf['theme'];
    //conexion resource
    //$str_conn = "sqlite3:////var/www/db/iptables.db";
    $pDB = new paloDB($arrConf['dsn_conn_database']);
    //actions
    $accion = getAction();
    switch ($accion) {
        case "new":
            $content = newRules($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, array());
            break;
        case "desactivate":
            $content = desactivateFirewall($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case "save":
            $content = saveRules($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case "getPorts":
            $content = getPorts($pDB);
            break;
        case "change":
            $content = change($pDB);
            break;
        case "changeOtherPage":
            $content = changeOtherPage($pDB, $module_name);
            break;
        case "exec":
            $content = execRules($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        case "delete":
            $content = deleteFilter($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
        default:
            $content = reportRules($smarty, $module_name, $local_templates_dir, $pDB, $arrConf);
            break;
    }
    return $content;
}
开发者ID:hardikk,项目名称:HNH,代码行数:61,代码来源:index.php

示例7: change

function change($source)
{
    $string = "";
    foreach ($source as $k => $v) {
        $string .= "<" . $k . ">";
        if (is_array($v) || is_object($v)) {
            //判断是否是数组,或者,对像
            $string .= change($v);
            //是数组或者对像就的递归调用
        } else {
            $string .= $v;
            //取得标签数据
        }
        $string .= "</" . $k . ">";
    }
    return $string;
}
开发者ID:linraine,项目名称:thinkphp-ozgweb,代码行数:17,代码来源:function.php

示例8: elseif

        } elseif ($announcement_name == 'footer_Announcement') {
            change($announcement_name);
        } elseif ($announcement_name == 'tos_content') {
            change($announcement_name);
        } elseif ($announcement_name == 'code_Announcement') {
            change($announcement_name);
        } elseif ($announcement_name == 'user_index_Announcement') {
            change($announcement_name);
        } elseif ($announcement_name == 'user_node_Announcement_node') {
            change($announcement_name);
        } elseif ($announcement_name == 'user_node_Announcement_node_pro') {
            change($announcement_name);
        } elseif ($announcement_name == 'user_invite_Announcement_color_orange') {
            change($announcement_name);
        } elseif ($announcement_name == 'user_invite_Announcement_color_blue') {
            change($announcement_name);
        }
    } else {
        $a['code'] = '0';
        $a['msg'] = "没有这个公告名称";
        echo json_encode($a, JSON_UNESCAPED_UNICODE);
        exit;
    }
} else {
    header("Location: change_announcement.php");
}
function change($announcement_name)
{
    global $sqlitedates;
    if (empty($_POST['new_content'])) {
        $a['code'] = '0';
开发者ID:haitao-wang,项目名称:sspanelplus,代码行数:31,代码来源:_change_announcement.php

示例9: show_table

    die;
}
require './../config.php';
require './../src/security.php';
$action = @$_POST['action'];
if ($action == 'show_table') {
    show_table();
}
if ($action == 'delete_row') {
    delete_row();
}
if ($action == 'new_row') {
    new_row();
}
if (preg_match('/change/', $action)) {
    change($action);
}
function show_table()
{
    $data = $GLOBALS['DB']->query("SELECT * FROM user");
    echo json_encode($data);
}
function delete_row()
{
    $id = (int) @$_POST['id'];
    $GLOBALS['DB']->query("DELETE FROM user WHERE id=?", array($id));
}
function change($action)
{
    $id = (int) @$_POST['id'];
    $value = security_filter(@$_POST['value']);
开发者ID:JNKKKK,项目名称:SS-Manager,代码行数:31,代码来源:user_manipulate.php

示例10: change_email

/**
 * @param string $edit
 * @param PDO $link
 * @return bool
 */
function change_email($edit, $link)
{
    $error = 0;
    if (isset($_POST[$edit])) {
        $_POST[$edit] = trim($_POST[$edit]);
    }
    $change = isset($_POST['edit']) ? $_POST['edit'] == $edit && ($error = parse_email($_POST[$edit])) === 0 ? true : false : false;
    if ($change) {
        if ($_POST[$edit] === $_SESSION['user_array']['email']) {
            change($edit, $link);
            return true;
        }
    }
    if ($change) {
        if ($_POST[$edit] === "") {
            change($edit, $link);
            $_SESSION['user_array']['confirmed_email'] = chr(0);
            return true;
        }
        if (captcha_verify_word()) {
            $sql = "SELECT user, email FROM confirmed_emails where email = :email";
            $stmt = $link->prepare($sql);
            $stmt->bindValue(':email', $_POST[$edit], PDO::PARAM_STR);
            if ($stmt->execute() !== false && ($row = $stmt->fetch(PDO::FETCH_ASSOC))) {
                if ($row['user'] !== $_SESSION['user_array']['user']) {
                    $error = 3;
                }
            }
            if (!$error) {
                if (change($edit, $link)) {
                    send_confirmation_email($_POST[$edit], $link);
                    $_SESSION['user_array']['email'] = $_POST[$edit];
                    echo PR_EMAIL . ': ' . $_SESSION['user_array']['email'] . " ";
                    echo (ord($_SESSION['user_array']['hemail']) ? PR_HIDDEN : PR_VISIBLE) . " [<a href=\"profile.phtml?user=" . $_SESSION['user_array']['user'] . "&edit=email\">" . PR_EDIT . "</a>] <span style=color:red>" . PR_SENT_1_A . "</span><script type='text/javascript'>alert(\"" . PR_SENT_1 . "\\n" . PR_SENT_2 . "\")</script><br />" . PHP_EOL;
                    return false;
                }
            }
        } else {
            $error = 4;
        }
    }
    echo "<form id=\"editForm\" method=\"POST\">" . PR_EMAIL . ": <input type=\"text\" id=\"" . $edit . "\" name=\"" . $edit . "\" value=\"" . $_SESSION['user_array'][$edit] . "\" onfocus=\"javascript:document.getElementById('focusId').value='" . $edit . "';\" />";
    echo "<input type=\"hidden\" id=\"focusId\" name=\"focusId\" value=\"" . $edit . "\">" . PHP_EOL;
    echo "<input type=\"hidden\" name=\"edit\" value=\"" . $edit . "\">" . PHP_EOL;
    echo "<input type=\"hidden\" name=\"user\" value=\"" . $_SESSION['user_array']['user'] . "\">" . PHP_EOL;
    echo "<input type=\"checkbox\" name=\"h" . $edit . "\" value=\"true\"";
    if (ord($_SESSION['user_array']['h' . $edit])) {
        echo " checked=\"checked\" ";
    }
    echo '/>' . PR_HIDE;
    switch ($error) {
        case 1:
            echo "<span style=\"color:red\"> " . PR_ERR_MAIL_LONG . "</span><script type='text/javascript'>focusId='" . $edit . "'</script>";
            break;
        case 2:
            echo "<span style=\"color:red\"> " . PR_ERR_MAIL_INVALID . "</span><script type='text/javascript'>focusId='" . $edit . "'</script>";
            break;
        case 3:
            echo "<span style=\"color:red\"> " . PR_ERR_MAIL_ALREADY_ASSOC . "</span><script type='text/javascript'>focusId='" . $edit . "';document.getElementById('" . $edit . "').value='" . $_POST[$edit] . "';</script>";
            break;
    }
    echo "<br /><span id=\"captchaImage\" style=\"border:0;width:140px;\"><img src=\"." . SYNAPP_CAPTCHA_PATH . "/captcha.image.php?nocache=" . hash("sha256", time() . mt_rand()) . "\" alt=\"captcha\"/></span><a \nhref=\"#\" onclick=\"updateCaptcha(null, '." . SYNAPP_CAPTCHA_PATH . "' );return false;\"><img src=\"." . SYNAPP_UI_RESOURCES_PATH . "/images/refresh.png\" style=\"border:0\" alt=\"" . PR_REFRESH . "\" title=\"" . PR_REFRESH . "\"/></a>";
    echo "<br />" . PR_CAPT . "<input type=\"text\" id=\"magicword\" " . "onfocus=\"javascript:document.getElementById('focusId').value='magicword';\" name=\"magicword\" autocomplete=\"off\" />";
    if ($error == 4) {
        echo "<span style=\"color:red\"> " . PR_ERR_CAPT . "</span><script type='text/javascript'>" . "focusId='magicword';document.getElementById('" . $edit . "').value='" . $_POST[$edit] . "';</script>";
    }
    echo '<br /></form>' . PHP_EOL;
    if (isset($_GET['alert']) && !count($_POST)) {
        if ($_GET['alert'] === "true") {
            echo "<script type='text/javascript'>alert(\"" . PR_VALIDATE_MAIL . "\")</script>";
        }
    }
    return false;
}
开发者ID:elcodedocle,项目名称:synapp,代码行数:79,代码来源:profile_edit.php

示例11: array

$context = array("user_id" => 1);
Exceptional::context($context);
// control which errors are caught with error_reporting
error_reporting(E_ALL | E_STRICT);
// start testing
echo $hi;
$math = 1 / 0;
function backtrace($i)
{
    if ($i < 6) {
        return backtrace($i + 1);
    }
    echo $cool;
}
backtrace(0);
function change(&$var)
{
}
change($var = 5);
class Foo
{
    public function bar()
    {
        throw new Exception("This is pretty neat!");
    }
}
$f = new Foo();
$f->bar();
// execution halts after exception_handler is called (PHP behavior)
// so code below never gets called
echo "This never gets called!";
开发者ID:ankane,项目名称:exceptional-php,代码行数:31,代码来源:advanced.php

示例12: mysql_connect

$con = mysql_connect($dbhost, $dbuser, $dbpasswd);
if (!$con) {
    die('{"status":false,"message":"Error connection to db"}');
}
mysql_select_db($dbname);
switch ($method) {
    case 'get':
        get($catid);
        break;
    case 'post':
        if (isset($catname)) {
            add($catname);
        }
        break;
    case 'put':
        change($catid, $catname);
        break;
    case 'delete':
        if (isset($catid)) {
            delete($catid);
        }
        break;
}
function change($catid, $catname)
{
    $query = "UPDATE categories SET catname = '" . $catname . "' WHERE id = " . $catid;
    if (mysql_query($query)) {
        echo '{"status":true}';
    } else {
        echo '{"status":false,"message":"Error executing query to db"}';
    }
开发者ID:vrevyuk,项目名称:sameer_test,代码行数:31,代码来源:categories.php

示例13: elseif

    if ($money < 0) {
        return "ERROR";
    } elseif ($money == 0) {
        return "ZERO";
    } else {
        $cash_reg = testCurrency($remaining, 'ONE HUNDRED', 100, $change);
        $cash_reg = testCurrency($cash_reg->remainder, 'FIFTY', 50, $cash_reg->change);
        $cash_reg = testCurrency($cash_reg->remainder, 'TWENTY', 20, $cash_reg->change);
        $cash_reg = testCurrency($cash_reg->remainder, 'TEN', 10, $cash_reg->change);
        $cash_reg = testCurrency($cash_reg->remainder, 'FIVE', 5, $cash_reg->change);
        $cash_reg = testCurrency($cash_reg->remainder, 'TWO', 2, $cash_reg->change);
        $cash_reg = testCurrency($cash_reg->remainder, 'ONE', 1, $cash_reg->change);
        $cash_reg = testCurrency($cash_reg->remainder, 'HALF DOLLAR', 0.5, $cash_reg->change);
        $cash_reg = testCurrency($cash_reg->remainder, 'QUARTER', 0.25, $cash_reg->change);
        $cash_reg = testCurrency($cash_reg->remainder, 'DIME', 0.1, $cash_reg->change);
        $cash_reg = testCurrency($cash_reg->remainder, 'NICKEL', 0.05, $cash_reg->change);
        $cash_reg = testCurrency($cash_reg->remainder, 'PENNY', 0.01, $cash_reg->change);
    }
    $change = $cash_reg->change;
    sort($change);
    return implode(",", $change);
}
$fh = fopen($argv[1], "r");
while (!feof($fh)) {
    $test = trim(fgets($fh));
    if ($test != "") {
        $args = explode(";", $test);
        echo change($args[1] - $args[0]) . "\n";
    }
}
fclose($fh);
开发者ID:heeena,项目名称:php-code-eval-solutions,代码行数:31,代码来源:cash_register.php

示例14: change

    $data = change($data, 3, 0, 1, 2);
}
if ($dir == "down") {
    usort($data, "cmp");
}
if ($dir == "up") {
    usort($data, "rcmp");
}
if ($sort == "creator") {
    $data = change($data, 1, 0, 2, 3);
}
if ($sort == "skin_pack") {
    $data = change($data, 1, 2, 0, 3);
}
if ($sort == "release_date") {
    $data = change($data, 1, 2, 3, 0);
}
if ($count_filtered) {
    if ($action == "filter_creator") {
        $creator = explode("/", $data[0])[1];
        $line = "<h3>All skins by creator '" . $creator . "' ";
        $line .= "<span style=\"font-size:10px\"><a href=\"edit/rename_creator.php" . $args . "&creator=" . urlencode($creator) . "\">rename</a></span> ";
        $line .= "<span style=\"font-size:10px\"><a href=\"edit/remove_creator.php" . $args . "&creator=" . urlencode($creator) . "\">remove</a></span> ";
        $line .= ": <a href=\"zip/creator/" . $creator . ".zip\" download=\"" . $creator . ".zip\">";
        $line .= "Download [" . $count_filtered . "]</a></h3>\n";
    }
    if ($action == "filter_skin_pack") {
        $skin_pack = explode("/", $data[0])[2];
        $line = "<h3>All skins from skin pack '" . $skin_pack . "' ";
        $line .= "<span style=\"font-size:10px\"><a href=\"edit/rename_skin_pack.php" . $args . "&skin_pack=" . urlencode($skin_pack) . "\">rename</a></span> ";
        $line .= "<span style=\"font-size:10px\"><a href=\"edit/remove_skin_pack.php" . $args . "&skin_pack=" . urlencode($skin_pack) . "\">remove</a></span> ";
开发者ID:Ameb,项目名称:ddnet-web,代码行数:31,代码来源:index.php

示例15: ajoute_dix

<?php

// Les fonctions se déclarent simplement comme cela:
function ajoute_dix($x)
{
    return $x + 10;
}
$x = 32;
$x = ajoute_dix($x);
echo "x = {$x}\n";
// x = 42
// PHP Permet de faire des références, on peut
// ainsi créer des variables qui ne sont que des
// alias
$a = 30;
$b =& $a;
$b += 12;
echo "a = {$a}\n";
// a = 42
// Les références peuvent aussi se faire en apellant
// des fonctions
function change(&$x)
{
    $x += 10;
}
$x = 32;
change($x);
echo "x = {$x}\n";
// x = 42
开发者ID:gregwar,项目名称:php,代码行数:29,代码来源:exemple2.php


注:本文中的change函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。