本文整理汇总了PHP中out函数的典型用法代码示例。如果您正苦于以下问题:PHP out函数的具体用法?PHP out怎么用?PHP out使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了out函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTableNameOptions
function getTableNameOptions()
{
$options = array();
$stmts = sqlStatement("SHOW TABLES");
for ($iter = 0; $row = sqlFetchArray($stmts); $iter++) {
foreach ($row as $key => $value) {
array_push($options, array("id" => out($value), "label" => out(xl($value))));
}
}
return $options;
}
示例2: render_chat_messages
/**
* Render the div full of chat messages.
* @param $chatlength Essentially the limit on the number of messages.
**/
function render_chat_messages($chatlength, $show_elipsis = null)
{
// Eventually there might be a reason to abstract out get_chats();
$sql = new DBAccess();
$sql->Query("SELECT sender_id, uname, message, age(now(), date) as ago FROM chat join players on chat.sender_id = player_id ORDER BY chat_id DESC LIMIT {$chatlength}");
// Pull messages
$chats = $sql->fetchAll();
$message_rows = '';
$messageCount = $sql->QueryItem("select count(*) from chat");
if (!isset($show_elipsis) && $messageCount > $chatlength) {
$show_elipsis = true;
}
$res = "<div class='chatMessages'>";
$previous_date = null;
$skip_interval = 3;
// minutes
foreach ($chats as $messageData) {
$l_ago = time_ago($messageData['ago'], $previous_date);
$message_rows .= "<li><<a href='player.php?player_id={$messageData['sender_id']}'\n\t\t target='main'>{$messageData['uname']}</a>> " . out($messageData['message']) . " <span class='chat-time'>{$l_ago}</span></li>";
$previous_date = $messageData['ago'];
// Store just prior date.
}
$res .= $message_rows;
if ($show_elipsis) {
// to indicate there are more chats available
$res .= ".<br>.<br>.<br>";
}
$res .= "</div>";
return $res;
}
示例3: __destruct
function __destruct()
{
out($this->Comment);
// this line doesn't crash PHP
out("\n<!-- End Section: " . $this->Comment . "-->");
// this line
}
示例4: uninstall
public function uninstall()
{
out(_("Removing Settings table"));
$sql = "DROP TABLE IF EXISTS miscdests";
$q = $this->db->prepare($sql);
$q->execute();
}
示例5: generic_error
function generic_error($error = 'unspecified')
{
global $session;
header('503 Unavailable');
$session->log(sprintf('JSON API error: "%s"', print_r($error, true)));
out(array('error' => $error));
}
示例6: showHelp
function showHelp()
{
global $argv;
out("USAGE:");
out(" " . $argv[0] . " --create|delete --exten <extension> [optional parameters]");
out("");
out("OPERATIONS (exactly one must be specified):");
out(" --create, -c");
out(" Create a new extension");
out(" --modify, -m");
out(" Modify an existing extension, the extension must exist and all values execept");
out(" those specified will remain the same");
out(" --delete, -d");
out(" Delete an extension");
out("PARAMETERS:");
out(" --exten extension_number");
out(" Extension number to create or delete. Must be specified.");
out("OPTIONAL PARAMETERS:");
out(" --name name");
out(" Display Name, defaults to specified extension number.");
out(" --outboundcid cid_number");
out(" Outbound CID Number, defaults to specified extension number.");
out(" --directdid did_number");
out(" Direct DID Number, defaults to extension number.");
out(" --vm-password password");
out(" Voicemail Password, defaults to specified extension number.");
out(" --sip-secret secret");
out(" SIP Secret, defaults to md5 hash of specified extension number.");
out(" --debug");
out(" Display debug messages.");
out(" --no-warnings");
out(" Do Not display warning messages.");
out(" --help, -h, -? Show this help");
}
示例7: install
function install($rootFolder)
{
out('Installing');
chdir("{$rootFolder}/htdocs");
getFile("{$rootFolder}/htdocs/dashboard.php", "https://raw.github.com/gist/1512137/dashboard.php");
return true;
}
示例8: need_user
function need_user()
{
if (!$_SESSION['user'] && !$_SESSION['extension']) {
echo out(array("success" => false, "message" => "User is undefined"));
exit;
}
}
示例9: log
private function log($message)
{
if ($this->output) {
$this->output->writeln($message);
} else {
out($message);
}
}
示例10: renderFileName
function renderFileName($fN)
{
global $input;
$f = pathinfo($input . $fN);
out($f['basename'], "Rendered", "Rendering", "\r");
renderFile($f['basename']);
out($f['basename'] . ' as ' . $f['filename'] . '.html', "Rendered");
}
示例11: out
protected function out($data=array(),$code=0,$msg='',$type=0,$outType='',$out=true)
{
if(!$outType)
{
$outType = $this->DEFAULT_OUT_TYPE;
}
out($data,$code,$msg,$type,$outType,$out);
}
示例12: getListOptions
function getListOptions($list_id)
{
$options = array();
$sql = sqlStatement("SELECT option_id, title from list_options WHERE list_id = ?", array($list_id));
for ($iter = 0; $row = sqlFetchArray($sql); $iter++) {
$options[] = new Option(out($row['option_id']), out(xl_list_label($row['title'])));
}
return $options;
}
示例13: framework_print_errors
function framework_print_errors($src, $dst, $errors)
{
out("error copying files:");
out(sprintf(_("'cp -rf' from src: '%s' to dst: '%s'...details follow"), $src, $dst));
freepbx_log(FPBX_LOG_ERROR, sprintf(_("framework couldn't copy file to %s"), $dst));
foreach ($errors as $error) {
out("{$error}");
freepbx_log(FPBX_LOG_ERROR, _("cp error output: {$error}"));
}
}
示例14: setDestination
function setDestination()
{
$destNo = $_POST['Destination'];
out($dest);
$list = array('1' => array('name' => 'village', 'hazards' => 2), '2' => array('name' => 'town', 'hazards' => 4), '3' => array('name' => 'city', 'hazards' => 6));
$dest = $list[$destNo];
$_SESSION["destination"] = $dest;
$_SESSION["hazards"] = $dest['hazards'];
$_SESSION["step"]++;
}
示例15: show_error
function show_error()
{
if ($msg = mysql_error()) {
out("<div style='background:#dadada'>");
out($msg);
out("</div>");
return true;
}
return false;
}