本文整理汇总了PHP中printArray函数的典型用法代码示例。如果您正苦于以下问题:PHP printArray函数的具体用法?PHP printArray怎么用?PHP printArray使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了printArray函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: printArray
function printArray($array, $title = null)
{
if ($title != null) {
echo "<h1>" . $title . "</h1>";
}
//fill table header
if (empty($array)) {
echo "No contents";
} else {
echo "<table border=1><tr>";
foreach ($array[0] as $key => $value) {
echo "<th>" . $key . "</th>";
}
echo "</tr>";
foreach ($array as $item) {
echo "<tr>";
foreach ($item as $key => $value) {
echo "<td>";
if (is_array($value)) {
printArray($value);
} elseif ($key == "Data") {
echo date('d/m/Y', strtotime($value));
} else {
echo $value;
}
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
}
}
开发者ID:vascofg,项目名称:sinf,代码行数:32,代码来源:globals.php
示例2: getPath
/**
* Get path of this route
* @since Version 3.9
* @return array
*/
public function getPath()
{
$params = array("mode" => 0, "line" => $this->route_id);
$stops = $this->fetch("stops-for-line", $params);
printArray($this->url);
printArray($stops);
}
开发者ID:railpage,项目名称:railpagecore,代码行数:12,代码来源:Route.php
示例3: send
/**
* @param null $host - $host of socket server
* @param null $port - port of socket server
* @param string $action - action to execute in sockt server
* @param null $data - message to socket server
* @param string $address - addres of socket.io on socket server
* @param string $transport - transport type
* @return bool
*/
public function send($action = "message", $data = null, $address = "socket.io/?EIO=2", $transport = 'websocket')
{
$fd = fsockopen($this->hostname, $this->port, $errno, $errstr);
if (!$fd) {
throw new Exception("Could not establish connection to " . $this->hostname . ":" . $this->port);
}
$key = $this->generateKey();
$out = "GET {$address}&transport={$transport} HTTP/1.1\r\n";
$out .= "Host: http://{$host}:{$port}\r\n";
$out .= "Upgrade: WebSocket\r\n";
$out .= "Connection: Upgrade\r\n";
$out .= "Sec-WebSocket-Key: {$key}\r\n";
$out .= "Sec-WebSocket-Version: 13\r\n";
$out .= "Origin: *\r\n\r\n";
fwrite($fd, $out);
// 101 switching protocols, see if echoes key
$result = fread($fd, 10000);
preg_match('#Sec-WebSocket-Accept:\\s(.*)$#mU', $result, $matches);
printArray($result);
$keyAccept = trim($matches[1]);
$expectedResonse = base64_encode(pack('H*', sha1($key . '258EAFA5-E914-47DA-95CA-C5AB0DC85B11')));
$handshaked = $keyAccept === $expectedResonse ? true : false;
if ($handshaked) {
fwrite($fd, $this->hybi10Encode('42["' . $action . '", "' . addslashes($data) . '"]'));
fread($fd, 1000000);
return true;
} else {
return false;
}
}
开发者ID:railpage,项目名称:railpagecore,代码行数:39,代码来源:SocketIO.php
示例4: getContent
function getContent()
{
$s = "<div>";
$s .= printArray($this);
$s .= "</div>";
return $s;
}
开发者ID:mobiskif,项目名称:VKonverte_PHP,代码行数:7,代码来源:classVisible.php
示例5: printAny
function printAny($text)
{
if (is_array($text)) {
printArray($text);
} else {
printText($text);
}
}
开发者ID:the-tool,项目名称:the-tool,代码行数:8,代码来源:index.blade.php
示例6: __construct
/**
* Constructor
* @since Version 3.2
* @var object $db
* @var object $User
*/
public function __construct($User = false)
{
parent::__construct();
if (!$User || !$User->id || $User->id == NULL || empty($User->id)) {
throw new \Exception("Cannot instantiate " . __CLASS__ . " - user object is empty or not loaded" . printArray(debug_backtrace()));
}
$this->User = $User;
}
开发者ID:doctorjbeam,项目名称:railpagecore,代码行数:14,代码来源:User.php
示例7: sortArrarTest
function sortArrarTest()
{
$number = array(10, 2, 10, 88, 7, 7, 3);
sort($number);
printArray($number);
rsort($number);
printArray($number);
}
开发者ID:xuefengyang,项目名称:PhpFirst,代码行数:8,代码来源:index.php
示例8: printArray
function printArray($array)
{
foreach ($array as $key => $value) {
echo "{$key} => {$value}";
if (is_array($value)) {
//If $value is an array, print it as well!
printArray($value);
}
}
}
开发者ID:vipak,项目名称:mashproject.github.io,代码行数:10,代码来源:subscribe.php
示例9: printArray
/**
* Определить рекурсивную функцию - аналог функции print_r
*/
function printArray(array &$arr)
{
if (key($arr) === null) {
reset($arr);
return 0;
} else {
echo '[' . key($arr) . ']' . ' => ' . current($arr) . '</br>';
next($arr);
printArray($arr);
}
reset($arr);
return 0;
}
开发者ID:selentsov,项目名称:homeworks,代码行数:16,代码来源:71.php
示例10: init
function init()
{
if (isset($_SESSION["user"])) {
return;
}
$tk = C('tk');
echo $tk;
if (empty($tk)) {
return false;
}
printArray($_SESSION["user"]);
$user = new Users();
$auth = $user->AuthAuto($tk);
}
开发者ID:cloverink,项目名称:lotto,代码行数:14,代码来源:auth.php
示例11: printArray
function printArray($array, $spaces = "")
{
$retValue = "";
if (is_array($array)) {
$spaces = $spaces . " ";
$retValue = $retValue . "<br/>";
foreach (array_keys($array) as $key) {
$retValue = $retValue . $spaces . "<strong>" . $key . "</strong>" . printArray($array[$key], $spaces);
}
$spaces = substr($spaces, 0, -30);
} else {
$retValue = $retValue . " - " . $array . "<br/>";
}
return $retValue;
}
开发者ID:nsystem1,项目名称:ZeeJong,代码行数:15,代码来源:newWiki.php
示例12: show
function show()
{
header('Content-Type: text/html; charset=utf-8');
if ($this->context->state->zakaz->debug) {
//if (TRUE) {
//echo $this->getContent();
echo '<style> .active {font-weight: bold;} </style>';
$this->include_();
echo "<hr/>" . printArray($this);
} else {
include TEMPL . '/header.html';
$this->include_();
include TEMPL . '/footer.html';
}
}
开发者ID:mobiskif,项目名称:VKonverte_PHP,代码行数:15,代码来源:View.php
示例13: echoBookList
/**
* Echo the list of videos in the specified feed.
*
* @param Zend_Gdata_Books_BookFeed $feed The video feed
* @return void
*/
function echoBookList($feed)
{
print <<<HTML
<table><tr><td id="resultcell">
<div id="searchResults">
<table class="volumeList"><tbody width="100%">
HTML;
$flipflop = false;
foreach ($feed as $entry) {
$title = printArray($entry->getTitles());
$volumeId = $entry->getVolumeId();
if ($thumbnailLink = $entry->getThumbnailLink()) {
$thumbnail = $thumbnailLink->href;
} else {
$thumbnail = null;
}
$preview = $entry->getPreviewLink()->href;
$embeddability = $entry->getEmbeddability()->getValue();
$creators = printArray($entry->getCreators());
if (!empty($creators)) {
$creators = "by " . $creators;
}
if ($embeddability == "http://schemas.google.com/books/2008#embeddable") {
$preview_link = '<a href="javascript:load_viewport(\'' . $preview . '\',\'viewport\');">' . '<img class="previewbutton" src="http://code.google.com/' . 'apis/books/images/gbs_preview_button1.png" />' . '</a><br>';
} else {
$preview_link = '';
}
$thumbnail_img = !$thumbnail ? '' : '<a href="' . $preview . '"><img src="' . $thumbnail . '"/></a>';
print <<<HTML
<tr>
<td><div class="thumbnail">
{$thumbnail_img}
</div></td>
<td width="100%">
<a href="{$preview}">{$title}</a><br>
{$creators}<br>
{$preview_link}
</td></tr>
HTML;
}
print <<<HTML
</table></div></td>
<td width=50% id="previewcell"><div id="viewport"></div>
</td></tr></table><br></body></html>
HTML;
}
开发者ID:natureday1,项目名称:Life,代码行数:52,代码来源:index.php
示例14: SuggestEvents
/**
* Suggest events to tag
* @since Version 3.10.0
* @param \Railpage\Images\Image $imageObject
* @return array
*/
public static function SuggestEvents(Image $imageObject)
{
if (!$imageObject->DateCaptured instanceof DateTime) {
return;
}
$Database = (new AppCore())->getDatabaseConnection();
$query = "SELECT COUNT(*) AS num FROM image_link WHERE namespace = ? AND image_id = ?";
$params = [(new Event())->namespace, $imageObject->id];
if ($Database->fetchOne($query, $params) > 0) {
return;
}
$Events = new Events();
$list = $Events->getEventsForDate($imageObject->DateCaptured);
foreach ($list as $k => $row) {
$Event = new Event($row['event_id']);
printArray($Event->namespace);
die;
$list[$k]['url'] = sprintf("/services?method=railpage.image.tag&image_id=%d&object=%s&object_id=%d", $imageObject->id, "\\Railpage\\Events\\Event", $row['event_id']);
}
return $list;
}
开发者ID:railpage,项目名称:railpagecore,代码行数:27,代码来源:Tagger.php
示例15: printArray
function printArray($arr)
{
if (!is_object($arr) and !is_array($arr)) {
return $arr;
} else {
if (is_object($arr)) {
$s = "Object: " . get_class($arr) . "<ul>";
foreach (get_object_vars($arr) as $key => $value) {
$s .= "<li>" . $key . " = " . printArray($value) . "</li>";
}
$s .= "</ul>";
return $s;
} else {
$s = "Array: <ul>";
foreach ($arr as $key => $value) {
$s .= "<li>" . $key . " = " . printArray($value) . "</li>";
}
$s .= "</ul>";
return $s;
}
}
}
开发者ID:mobiskif,项目名称:VKonverte_PHP,代码行数:22,代码来源:include.php
示例16: printArray
echo printArray($listItem);
}
echo '<BR>End of list.<BR><BR>';
}
i5_jobLog_list_close($list);
}
if ($doAdoptAuthority) {
echo h2('Adopt authority');
// Note: only works if you've defined $user and $testPw, and created the user profile.
echo "About to adopt authority to user {$user}<BR>";
$start = microtime(true);
$success = i5_adopt_authority($user, $testPw);
$end = microtime(true);
$elapsed = $end - $start;
if (!$success) {
echo "Error adopting authority: " . printArray(i5_error()) . "<BR>";
} else {
echo "Success adopting authority in {$elapsed} seconds<BR>";
echo "About to check current user and other variables after adopting authority.<BR>";
$cmdString = 'RTVJOBA';
$input = array();
$output = array('ccsid' => array('ccsid', 'dec(5 0)'), 'dftccsid' => array('defaultCcsid', 'dec(5 0)'), 'curuser' => 'currentUser', 'nbr' => 'jobNumber', 'job' => 'jobName', 'user' => 'jobUser', 'usrlibl' => 'userLibl');
$commandSuccessful = i5_command($cmdString, $input, $output, $conn);
if (function_exists('i5_output')) {
extract(i5_output());
}
// i5_output() required if called in a function
echo "Ran command {$cmdString}. Return: " . OkBad($commandSuccessful) . " with original job user '{$jobUser}', current user '{$currentUser}', CCSID '{$ccsid}', default CCSID '{$defaultCcsid}', job name '{$jobName}', job number '{$jobNumber}', with user liblist '{$userLibl}'.<BR><BR>";
}
}
$ret = i5_close($conn);
开发者ID:zendtech,项目名称:ibmitoolkit,代码行数:31,代码来源:cwtest.php
示例17: printArray
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "_lib/php/auth.php";
printArray($_POST);
filterQryPost("id");
$id = hex2str($id);
filterQryPost("rid");
filterQryPost("val");
filterQryPost("edit");
filterQryPost("pri");
switch ($edit) {
case 0:
$gdbo->sql = "insert into _srv_descr (srv_descr_privateBit,id_srv,srv_descr,id_sys_user,srv_descr_du) values ({$pri},{$id},'{$val}',{$id_sys_user},current_timestamp)";
$gdbo->dbTable = "_srv_descr";
$gdbo->execQuery();
break;
case 1:
$gdbo->sql = "update _srv_descr set srv_descr_privateBit={$pri},srv_descr_du=current_timestamp,id_srv={$id},srv_descr='{$val}',id_sys_user={$id_sys_user} where id_srv_descr={$rid}";
$gdbo->dbTable = "_srv_descr";
开发者ID:CarlosOVillanueva,项目名称:BIFROST,代码行数:30,代码来源:sql_descr.php
示例18: toStr
function toStr($bin)
{
$simplifiedBin = array();
$binIndex = 0;
$msglen = sizeof($bin) / 7;
for ($i = 0; $i < $msglen; $i++) {
$temp = "";
for ($j = 0; $j < 7; $j++) {
$temp[] .= $bin[$binIndex];
$binIndex++;
}
$temp = implode("", $temp);
$simplifiedBin[] = $temp;
}
printArray($simplifiedBin);
$char = array();
for ($i = 0; $i < sizeof($simplifiedBin); $i++) {
$char[$i] = chr(bindec($simplifiedBin[$i]));
}
printArray($char);
}
开发者ID:Zaaptastic,项目名称:ImageEncrypt,代码行数:21,代码来源:test.php
示例19: printobject
function printobject($object)
{
if (!is_object($object)) {
print 'Not an object';
return;
}
$class = get_class($object);
print "Class: {$class}<br/>";
$vars = get_object_vars($object);
print 'Vars:';
printArray($vars);
}
开发者ID:gillima,项目名称:phplist3,代码行数:12,代码来源:connect.php
示例20: foreach
</h4>
<hr />
<?php
// Sorting was already completed within the 7.2 question.
foreach ($combinedArray as $element) {
$element = strtoupper($element);
}
printArray($combinedArray);
echo "\n";
?>
</div>
<div>
<h4>
7.4 Using functions (built-in and/or your own), generate a new
array of dorms that are good, but not big.
</h4>
<hr />
<?php
//Getting the values within the $goodDorms but not in $bigDorms.
$goodNotBigDorms = array_diff($goodDorms, $bigDorms);
printArray($goodNotBigDorms);
echo "\n";
?>
</div>
</div>
<script src="js/jquery-2.1.3.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
开发者ID:justinbtadlock,项目名称:lis4368_a2,代码行数:30,代码来源:exercise.php
注:本文中的printArray函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论