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


PHP say函数代码示例

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


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

示例1: test_count_all

 function test_count_all()
 {
     //依数据库中已有一条记录而断言
     $this->assertEqual($this->base_model->count_all(), 1);
     //删除这条记录之后断言返回0
     $sql = "TRUNCATE TABLE `test_table`;";
     $this->assertTrue($this->_CI->db->query($sql));
     say('Truncate test_table ok.');
     $this->assertEqual($this->base_model->count_all(), 0);
 }
开发者ID:nnrv1ncentsh1,项目名称:MADA,代码行数:10,代码来源:test_base_model.php

示例2: process

function process($user, $msg)
{
    $msg = unwrap($msg);
    // remove chr(0) and chr(255)
    say("< " . $msg);
    $parts = explode("|", $msg);
    // CHAT|NICK|MESSAGE
    $action = strtoupper($parts[0]);
    switch ($action) {
        case "HELO":
            welcome($user, $parts[1], $parts[2]);
            break;
            // HELO|NICK|AVATAR
        // HELO|NICK|AVATAR
        case "CHAT":
            chat($user, $parts[2]);
            break;
            // CHAT|NICK|MESSAGE
        // CHAT|NICK|MESSAGE
        case "PRIV":
            break;
            // TODO: private chat
        // TODO: private chat
        case "EXIT":
            goodbye($user);
            break;
            // EXIT|NICK
        // EXIT|NICK
        default:
            console($action . " not understood");
            break;
    }
}
开发者ID:GeorgeNava,项目名称:phpwebsocketchat,代码行数:33,代码来源:chatserver.php

示例3: tearDown

 function tearDown()
 {
     $sql = 'DROP TABLE IF EXISTS `solution`;';
     $this->assertTrue($this->_CI->db->query($sql));
     $sql = 'DROP TABLE IF EXISTS `forward`;';
     $this->assertTrue($this->_CI->db->query($sql));
     say('Delete test_tables ok.');
 }
开发者ID:nnrv1ncentsh1,项目名称:MADA,代码行数:8,代码来源:test_forward_model.php

示例4: setAliases

 public function setAliases()
 {
     if (!is_array($this->aliases)) {
         say("You must load your Aliases file in ./cmd");
         exit;
     }
     foreach ($this->aliases as $name => $path) {
         Yii::setAlias($name, $path);
     }
 }
开发者ID:Vincent-X,项目名称:yii2-app-advanced,代码行数:10,代码来源:App.php

示例5: fnShowMsg

function fnShowMsg($title, $msg)
{
    //Construye mensaje en  una tabla
    say("<table width='2500'>");
    say("<tr>");
    say("<th align=center valing=middle>{$title}</th>");
    say("</tr>");
    say("<tr>");
    say("<td align=left valing=middle>{$msg}</td>");
    say("</tr>");
    say("</table>");
}
开发者ID:cbunay,项目名称:VRS,代码行数:12,代码来源:Funciones.php

示例6: process

function process($user_sent, $msg)
{
    global $sockets, $users;
    $ms = unwrap($msg);
    $obj = json_decode($ms);
    $action = $obj->msg;
    say("< " . $action);
    foreach ($users as &$user) {
        if ($user != $user_sent) {
            send($user->socket, $action);
        }
    }
}
开发者ID:jayralencar,项目名称:phpwebsocket,代码行数:13,代码来源:server.php

示例7: loop_tests

function loop_tests($cmd, $line_func)
{
    global $results;
    $ftest = popen($cmd, 'r');
    if (!$ftest) {
        echo "Couldn't run test script\n";
        exit(1);
    }
    while (!feof($ftest)) {
        $line = fgets($ftest);
        $line_func($line);
    }
    say(array('op' => 'all_done', 'results' => $results));
    fclose($ftest);
}
开发者ID:RavuAlHemio,项目名称:hhvm,代码行数:15,代码来源:fbmake_test_binary_wrapper.php

示例8: f2

function f2($url)
{
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
    $json = curl_exec($ch);
    curl_close($ch);
    $ans = json_decode($json, true);
    $x = 0;
    foreach ($ans["sample"] as $key => $values) {
        say($ans["sample"][$x]["data"]);
        wait(500);
        $x++;
    }
}
开发者ID:surajpoojary,项目名称:GitProjects,代码行数:18,代码来源:utalk.php

示例9: checkCorrectFileRights

function checkCorrectFileRights()
{
    say("Pruefe, ob die wichtigsten Schreibrechte gesetzt sind...");
    // Verzeichnisse, die geprueft werden sollen,
    // MUESSEN mit einem Slash enden!
    $asWritableFiles = array(DIR_SHOP_ROOT . 'bb.rpc.cookie', DIR_COMPILED, DIR_IMAGES, DIR_SETTINGS . 'global.ini', DIR_SRC_SCSS . '_ci.scss');
    $asUnwritableFiles = array();
    foreach ($asWritableFiles as $sPath) {
        // Dürfen bestehende Dateien überschrieben werden?
        if (file_exists($sPath)) {
            if (!is_writable($sPath)) {
                $asUnwritableFiles[] = $sPath;
            }
        } else {
            // Darf Verzeichnis erstellt werden?
            if (substr($sPath, -1) === '/') {
                if (!mkdir($sPath, 740)) {
                    $asUnwritableFiles[] = $sPath;
                }
                // Darf Datei erstellt werden?
            } else {
                if (!touch($sPath)) {
                    $asUnwritableFiles[] = $sPath;
                }
            }
        }
    }
    if (count($asUnwritableFiles)) {
        say('Bitte korrigieren Sie die Schreibrechte fuer folgende Dateien und Ordner: ');
        say($asUnwritableFiles);
        // Ist die global.ini nicht beschreibbar, so koennen wir gleich aufhören.
        if (in_array(DIR_SETTINGS . 'global.ini', $asUnwritableFiles)) {
            say(array('', 'Damit der Konfigurationsassistent kann nicht fortgefuehrt werden, ', 'da die global.ini nicht vom aktuellen PHP-Prozess beschrieben werden darf. ', '', 'Bitte setzen Sie die korrekten Schreibrechte fuer die settings/global.ini. ', 'Informationen hierzu erhalten Sie unter ', 'https://doku.premium-admin.eu/doku.php/handbuch/shop_2.0/installation/start#schreibrechte_setzen_optional'));
            exit(1);
        }
        return false;
    }
    return true;
}
开发者ID:enigmatic-user,项目名称:resellershop,代码行数:39,代码来源:init-global.php

示例10: start_turnir

 function start_turnir()
 {
     $loc = array('0x0', '1x0', '2x0', '3x0', '4x0', '5x0', '6x0', '13x0', '6x1', '10x1', '11x1', '12x1', '13x1', '16x1', '17x1', '18x1', '19x1', '6x2', '10x2', '16x2', '0x3', '1x3', '2x3', '3x3', '4x3', '5x3', '6x3', '10x3', '13x3', '14x3', '15x3', '16x3', '0x4', '10x4', '13x4', '0x5', '1x5', '2x5', '8x5', '9x5', '10x5', '13x5', '14x5', '15x5', '16x5', '17x5', '18x5', '19x5', '2x6', '8x6', '19x6', '2x7', '8x7', '9x7', '10x7', '11x7', '19x7', '2x8', '11x8', '19x8', '2x9', '3x9', '4x9', '5x9', '6x9', '11x9', '15x9', '16x9', '17x9', '18x9', '19x9', '6x10', '11x10', '15x10', '19x10', '6x11', '11x11', '15x11', '19x11', '1x12', '2x12', '3x12', '4x12', '5x12', '6x12', '11x12', '12x12', '13x12', '14x12', '15x12', '16x12', '17x12', '1x13', '17x13', '1x14', '2x14', '3x14', '4x14', '5x14', '6x14', '7x14', '8x14', '9x14', '17x14', '1x15', '9x15', '17x15', '1x16', '9x16', '17x16', '18x16', '1x17', '2x17', '3x17', '4x17', '9x17', '10x17', '11x17', '12x17', '13x17', '14x17', '18x17', '1x18', '4x18', '5x18', '6x18', '14x18', '18x18', '1x19', '6x19', '7x19', '8x19', '9x19', '10x19', '11x19', '14x19', '15x19', '16x19', '17x19', '18x19');
     // вычисляем кто прошел в турнир
     $dat = mysql_query("SELECT dt.owner FROM `deztow_stavka` as dt, `online` as o WHERE o.login = dt.owner AND room = 'smert_room' ORDER by `kredit` DESC, dt.`time` ASC  LIMIT 20;");
     if (mysql_num_rows($dat)) {
         $have_bs = mysql_fetch_array(mysql_query("SELECT * FROM `deztow_turnir` WHERE `active` = 1"));
         if (!$have_bs) {
             $stavka = mysql_fetch_array(mysql_query("SELECT SUM(`kredit`)*0.75 FROM `deztow_stavka`;"));
             while ($row = mysql_fetch_array($dat)) {
                 shuffle($loc);
                 $coord = $loc[0];
                 // пихаем учасников в БС
                 mysql_query("UPDATE users SET bs=1, location='" . $coord . "',vector=0 WHERE login='" . $row[0] . "'");
                 mysql_query("DELETE FROM labirint WHERE user_id='" . $row[0] . "'");
                 mysql_query("INSERT INTO labirint(user_id, location, vector, visit_time) VALUES('" . $row[0] . "', '" . $coord . "', '0', '" . time() . "')");
                 // список участников
                 $lors .= $comma . "<b>" . $row[0] . "</b>";
                 $comma = ", ";
             }
             say("toall_news", "<font color=red>Турнир Начался...Участники: {$lors}</font>", $_SESSION["login"]);
             // формируем лог и создаем запись о турнире
             $log = '<span class=date>' . date("d.m.y H:i") . '</span> Начало турнира. Участники: ' . $lors . '<BR>';
             mysql_query("INSERT `deztow_turnir` (`type`,`winner`,`coin`,`start_time`,`log`,`endtime`,`active`) values ('" . rand(1, 7) . "','','" . $stavka[0] . "','" . time() . "','" . $log . "','0','1');");
             shuffle($loc);
             $count_wmot = mysql_num_rows(mysql_query("SELECT id FROM bs_objects"));
             for ($i = 1; $i <= $count_wmot; $i++) {
                 mysql_query("UPDATE bs_objects SET coord='" . $loc[$i] . "' WHERE id={$i}");
             }
         }
     } else {
         mysql_query('DELETE FROM `deztow_turnir` WHERE `active` = TRUE');
         mysql_query('UPDATE `variables` SET `value` = \'' . (time() + 10 * 60) . '\' WHERE `var` = \'startbs\';');
         mysql_query("TRUNCATE TABLE `deztow_stavka`;");
     }
 }
开发者ID:ehmedov,项目名称:www,代码行数:36,代码来源:smert_room.php

示例11: floor

        $hours = floor(SILENT / 60);
        $minutes = SILENT - $hours * 60;
        if ($hours > 0) {
            if ($hours == 2 || $hours == 24) {
                $hours_d = "{$hours} часа";
            } else {
                $hours_d = "{$hours} часов";
            }
            $minutes_d = "";
        } else {
            $hours_d = "";
            $minutes_d = "{$minutes} минут";
        }
        $pref = $db["sex"];
        if ($pref == "female") {
            $prefix = "а";
        } else {
            $prefix = "";
        }
        if ($reason != "") {
            $reson = "<b>Причина:</b> <i>" . $reason . "</i>";
        } else {
            $reson = "";
        }
        say("toall", "Представитель порядка <b>&laquo;" . $login . "&raquo;</b> использовал{$prefix} заклятие молчания на персонажа <b>&laquo;" . $res['login'] . "&raquo;</b> на {$hours_d} {$minutes_d}. {$reson}", $login);
        history($target, "Молчанка на 15 мин.", $reson, $ip, $login);
        history($login, "Молчанка на 15 мин.", $reson, $ip, $target);
        $time_d = $hours_d . "  " . $minutes_d;
        echo "Кляп засунут в рот <b>" . $target . "</b>. Он будет молчать " . $time_d;
    }
}
开发者ID:ehmedov,项目名称:www,代码行数:31,代码来源:molch15.php

示例12: lose

function lose($team, $battle, $phrase)
{
    $date = date("H:i");
    $sql_bat = mysql_query("SELECT zayavka.type,battles.creator_id FROM `battles` LEFT JOIN zayavka on zayavka.creator=battles.creator_id WHERE battles.id={$battle}");
    $B_DAT = mysql_fetch_array($sql_bat);
    mysql_free_result($sql_bat);
    $cr = $B_DAT["creator_id"];
    $zay_type = $B_DAT["type"];
    $boylar = array(3, 4, 101, 5, 6, 102, 11);
    $T = mysql_query("SELECT player,hitted FROM teams WHERE battle_id='" . $cr . "' AND over=0 and team='" . $team . "'");
    while ($DATA = mysql_fetch_array($T)) {
        $player = $DATA["player"];
        $hitted_win = $DATA["hitted"];
        if ($zay_type == 15) {
            mysql_query('UPDATE labirint SET location="29x15", vector="180" WHERE user_id="' . $player . '"');
        }
        if ($zay_type == 88) {
            mysql_query('UPDATE labirint SET location="29x2", vector="180", lose=lose+1 WHERE user_id="' . $player . '"');
        }
        if ($zay_type == 89) {
            mysql_query('UPDATE labirint SET lose=lose+1 WHERE user_id="' . $player . '"');
        }
        //-------------------------------------------------------------------------------------
        $LOSER_QUERY_D = mysql_query("SELECT users.*,zver.energy FROM users LEFT join zver on zver.owner=users.id and zver.sleep=0 WHERE login='" . $player . "'");
        $LOSER_DATA = mysql_fetch_array($LOSER_QUERY_D);
        mysql_free_result($LOSER_QUERY_D);
        $objects = array();
        $objects[0] = $LOSER_DATA["amulet"];
        $objects[1] = $LOSER_DATA["hand_r"];
        $objects[2] = $LOSER_DATA["armour"];
        $objects[3] = $LOSER_DATA["poyas"];
        $objects[4] = $LOSER_DATA["ring1"];
        $objects[5] = $LOSER_DATA["ring2"];
        $objects[6] = $LOSER_DATA["ring3"];
        $objects[7] = $LOSER_DATA["helmet"];
        $objects[8] = $LOSER_DATA["perchi"];
        $objects[9] = $LOSER_DATA["hand_l"];
        $objects[10] = $LOSER_DATA["boots"];
        $objects[11] = $LOSER_DATA["naruchi"];
        $objects[12] = $LOSER_DATA["rubaxa"];
        $objects[13] = $LOSER_DATA["plash"];
        $objects[14] = $LOSER_DATA["mask"];
        $objects[15] = $LOSER_DATA["pants"];
        $objects[16] = $LOSER_DATA["masdrikon"];
        $objects[17] = $LOSER_DATA["rukavic"];
        $damage = 0;
        shuffle($objects);
        foreach ($objects as $key => $value) {
            if ($value == 0) {
                unset($objects[$key]);
            }
        }
        $new_array = array_values($objects);
        $damage = $new_array[0];
        if ($damage != 0) {
            $GET_F_INV = mysql_query("SELECT paltar.name,inv.iznos_max,inv.iznos FROM inv LEFT JOIN paltar on paltar.id=inv.object_id WHERE inv.id=" . $damage);
            $GET_D = mysql_fetch_array($GET_F_INV);
            mysql_free_result($GET_F_INV);
            $iznos_all = $GET_D["iznos_max"];
            $iznos = $GET_D["iznos"] + 1;
            $obj_name = $GET_D["name"];
            $krit_iznos = $iznos_all - 2;
            if ($iznos >= $krit_iznos && $iznos < $iznos_all) {
                talk($player, "Предмет <b>" . $obj_name . "</b> в критическом состоянии!<BR><small>(на правах рекламы) <b>Ремонтная мастерская</b>. Мы даем вторую жизнь старым вещам!</small>", $LOSER_DATA);
            }
            if ($iznos <= $iznos_all) {
                mysql_query("UPDATE inv SET iznos =iznos+1 WHERE id = '" . $damage . "'");
            }
            if ($iznos_all == 1) {
                unWear($player, $damage);
                mysql_query("DELETE FROM inv WHERE id='" . $damage . "'");
                history($player, 'Пришел в негодность', $obj_name, $LOSER_DATA["remote_ip"], "Бой " . $battle);
                talk($player, "Предмет <b>" . $obj_name . "</b> сломался", $LOSER_DATA);
            } else {
                if ($iznos == $iznos_all) {
                    unWear($player, $damage);
                    talk($player, "Предмет <b>" . $obj_name . "</b> нуждается в ремонте!<BR><small>(на правах рекламы) <b>Ремонтная мастерская</b>. Мы даем вторую жизнь старым вещам!</small>", $LOSER_DATA);
                }
            }
        }
        if ($zay_type == 29) {
            #Пещера Воинов
            mysql_query("UPDATE users SET zayava=0 WHERE login='" . $player . "'");
            mysql_query("UPDATE war_team SET lose=1 WHERE player='" . $player . "'");
            say("toroom", "<b>{$player}</b> трагически погиб и покидает турнир.", $player);
        }
        if ($zay_type == 99 || $zay_type == 66) {
            mysql_query("UPDATE users SET bs=0,location='', vector='' WHERE login='" . $player . "'");
            $str = "<span class=date>" . date("d.m.y H:i") . "</span> <script>drwfl('" . $LOSER_DATA['login'] . "','" . $LOSER_DATA['id'] . "','" . $LOSER_DATA['level'] . "','" . $LOSER_DATA['dealer'] . "','" . $LOSER_DATA['orden'] . "','" . $LOSER_DATA['admin_level'] . "','" . $LOSER_DATA['clan_short'] . "','" . $LOSER_DATA['clan'] . "');</script> повержен и выбывает из турнира<BR>";
            mysql_query('UPDATE `deztow_turnir` SET `log` = CONCAT(`log`,"' . $str . '") WHERE `active` = TRUE');
            mysql_Query("DELETE FROM labirint WHERE user_id='" . $player . "'");
            mysql_Query("UPDATE bs_objects SET bs=0,owner='',coord='" . $LOSER_DATA["location"] . "' WHERE owner='" . $player . "'");
            mysql_query("DELETE FROM inv WHERE owner='" . $player . "' and object_razdel='thing' and object_id=24 LIMIT 1");
            say("toroom", "<b>{$player}</b> трагически погиб и покидает турнир.", $player);
        }
        if ($zay_type == 19) {
            //Таинственный Маяк
            $have_hell = mysql_fetch_Array(mysql_Query("SELECT * FROM hellround_pohod WHERE `end` = 0 and `owner`=" . $LOSER_DATA["id"] . ";"));
            $count_wood = $have_hell["volna"];
            for ($i = 0; $i < $count_wood; $i++) {
//.........这里部分代码省略.........
开发者ID:ehmedov,项目名称:www,代码行数:101,代码来源:functions.php

示例13: prompt

$result = prompt("Hello.  Please enter your 5 digit ZIP code", array("choices" => "[5 DIGITS]"));
if ($result->name == 'choice') {
    say("Great, you said " . $result->value);
}
// Digits work with speech or touch-tone input...
$result = prompt("Hello.  Please say or enter your 5 digit ZIP code", array("choices" => "[5 DIGITS]"));
if ($result->name == 'choice') {
    say("Great, you said " . $result->value);
}
// ask for 1 to 6 digit long an account ID
$result = prompt("Please enter your account ID followed by the pound key.", array("choices" => "[1-6 DIGITS]"));
if ($result->name == 'choice') {
    say("Great, you said " . $result->value);
}
// ask for a US phone number (7 digits without area code, 10 digits with)
$result = prompt("Please enter your 7 to 10 digit U.S. phone number", array("choices" => "[7-10 DIGITS]"));
if ($result->name == 'choice') {
    say("Great, you said " . $result->value);
}
// digit collection also supports all other prompt properties and event handlers
_log("\$***********************result name " . $result->name);
while ($result->name != 'hangup') {
    // collect 3 digits.  Reprompt up to 3 times.  Use a 7 second timeout...
    $result = prompt("Now please enter a number between 1 and 999", array("choices" => "[1-3 DIGITS]", "repeat" => 3, "timeout" => 7, "onBadChoice" => create_function('$event', 'say("I am sorry, I did not understand what you said.");'), "onTimeout" => create_function('$event', 'say("I am sorry.  I didn\'t hear anything.");')));
    _log("{$result} name " . $result->name);
    _log("number is " . $result->value);
    if ($result->name == 'choice') {
        say("Great, you said " . $result->value);
    }
}
hangup();
开发者ID:johntdyer,项目名称:tropo-samples,代码行数:31,代码来源:17-collectmoredigits.php

示例14: send

function send($client, $msg)
{
    say("> " . $msg);
    $msg = wrap($msg);
    socket_write($client, $msg, strlen($msg));
}
开发者ID:GeorgeNava,项目名称:phpwebsocket,代码行数:6,代码来源:server.php

示例15: mysql_query

    $q = mysql_query("select * from users where login='" . $target . "'");
    $res = mysql_fetch_array($q);
    if (!$res) {
        echo "ѕерсонаж <B>" . $target . "</B> не найден в базе данных.";
        die;
    }
    if ($res['login'] == "—ќ«ƒј“≈Ћ№") {
        echo "–едактирование богов запрещено высшей силой!";
        die;
    }
    if ($db["adminsite"] != 5) {
        if ($res['adminsite'] >= 5 || $res["admin_level"] >= 9) {
            echo "ѕерсонаж <B>{$target}</B> не найден в базе данных.";
            die;
        }
    }
    $chas = date("H");
    $vaxt = date("d.m.Y H:i:s", mktime($chas - $GSM));
    mysql_query("UPDATE users SET blok='1',blok_reason='" . $reason . " (" . $vaxt . ", " . $login . ")',metka='' WHERE login='" . $target . "'");
    mysql_query("DELETE FROM online WHERE login='" . $target . "'");
    $pref = $db["sex"];
    if ($pref == "female") {
        $prefix = "а";
    } else {
        $prefix = "";
    }
    say("toall", "<font color=#40404A>—мерть ƒуши <b>&laquo;" . $login . "&raquo;</b> отрубил{$prefix} голову персонажа <b>&laquo;" . $target . "&raquo;</b></font>.", $login);
    echo "ѕерсонаж <B>{$target}</B> казнен.";
    history($_POST['target'], " ј«Ќ≈Ќ", $reson, $ip, $login);
    history($login, " ј«Ќ»Ћ персонажа {$target}", $reson, $ip, $target);
}
开发者ID:ehmedov,项目名称:www,代码行数:31,代码来源:blok.php


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