本文整理汇总了PHP中print_array函数的典型用法代码示例。如果您正苦于以下问题:PHP print_array函数的具体用法?PHP print_array怎么用?PHP print_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_array函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: print_array
function print_array($data_, $n_ = 0)
{
if (is_array($data_)) {
foreach ($data_ as $k => $v) {
for ($i = 0; $i < $n_; $i++) {
echo '.';
}
echo "<strong>{$k}</strong> => { ";
if (is_array($v)) {
echo "<br />\n";
print_array($v, $n_ + 4);
for ($i = 0; $i < $n_; $i++) {
echo '.';
}
echo " }<br />\n";
} else {
echo $v . " }<br />\n";
}
}
} else {
for ($i = 0; $i < $n_; $i++) {
echo '.';
}
echo $data_ . "<br>\n";
}
}
开发者ID:skdong,项目名称:nfs-ovd,代码行数:26,代码来源:misc.inc.php
示例2: drawline_handle_fatal
function drawline_handle_fatal()
{
$error = error_get_last();
if ($error !== NULL) {
print_array($error);
}
}
开发者ID:double-web,项目名称:drawline,代码行数:7,代码来源:service_error_reporting.php
示例3: print_array
function print_array($array)
{
$result = '';
foreach ($array as $b => $param) {
$result .= "<br/> {$b} => ";
try {
if (is_array($param)) {
$result .= print_array($param);
} else {
if (is_object($param)) {
$result .= print_r($param);
} else {
if (is_string($param)) {
$result .= $param;
} else {
$result .= print_r($param);
}
}
}
} catch (Exception $e) {
$result .= print_r($e);
}
}
return $result;
}
开发者ID:ruslanBik4,项目名称:allservice_in_ua,代码行数:25,代码来源:error_log.php
示例4: print_power_sets
function print_power_sets($arr)
{
echo "POWER SET of [" . join(", ", $arr) . "]<br>";
foreach (power_set($arr) as $subset) {
print_array($subset);
}
}
开发者ID:pombredanne,项目名称:fuzzer-fat-fingers,代码行数:7,代码来源:Power.php
示例5: test_from_wx_3g
function test_from_wx_3g()
{
// print_r($_SERVER);
$array = getallheaders();
// print_r($array);
print_array($array);
}
开发者ID:iHamburg,项目名称:kqserver,代码行数:7,代码来源:testmodels.php
示例6: print_array
function print_array( $array ) {
$result = '';
foreach( $array as $b => $param)
if ( is_array($param) )
$result .= print_array( $param );
else
$result .= "$b => $param<br/>";
return $result;
}
开发者ID:ruslanBik4,项目名称:allservice_in_ua,代码行数:10,代码来源:params.php
示例7: merge_sort
function merge_sort(&$a, $l = 0, $r = -1, $tmp_v = array())
{
// gestisce la prima chiamata, quella senza argomenti
if ($r == -1) {
$r = count($a) - 1;
$tmp_v = $a;
}
// Distingue i casi elementari (1 o 2 elementi)
if ($l == $r) {
$pa = array_slice($a, $l, $r - $l + 1);
print_array($pa, "Dividi - caso elementare 1 elemento", "({$l} {$r})");
} elseif ($r == $l + 1) {
$pa = array_slice($a, $l, $r - $l + 1);
print_array($pa, "Dividi - caso elementare 2 elementi", "({$l} {$r})");
if ($a[$l] > $a[$r]) {
$tmp = $a[$r];
$a[$r] = $a[$l];
$a[$l] = $tmp;
}
$pa = array_slice($a, $l, $r - $l + 1);
print_array($pa, "Ordina - caso elementare 2 elementi", "({$l} {$r})");
} elseif ($l != $r) {
// Caso non elementare
$pa = array_slice($a, $l, $r - $l + 1);
print_array($pa, "Dividi - caso non elementare elementi", "({$l} {$r})");
$center = round(($l + $r) / 2, 0, PHP_ROUND_HALF_DOWN);
merge_sort($a, $l, $center);
merge_sort($a, $center + 1, $r);
}
// merge
$n = $r - $l + 1;
$c = round($n / 2, 0);
for ($i = 0; $i < $n; $i++) {
$tmp_v[$i] = $a[$l + $i];
}
$i = $j = 0;
while ($i < $c && $j < $n - $c) {
if ($tmp_v[$i] < $tmp_v[$c + $j]) {
$a[$l + $i + $j] = $tmp_v[$i];
$i++;
} else {
$a[$l + $i + $j] = $tmp_v[$c + $j];
$j++;
}
}
while ($i < $c) {
$a[$l + $i + $j] = $tmp_v[$i];
$i++;
}
$pa = array_slice($a, $l, $r - $l + 1);
print_array($pa, "Fondi ", "({$l} {$r})");
}
开发者ID:gionatamassibenincasa,项目名称:15-16_5_A_SIA,代码行数:52,代码来源:merge_sort.php
示例8: printDebug
/**
//作者:Zerolone
//日期:20060306
//修改:20070421 -- 添加变量调试信息
//功能:显示调试信息
//返回:
*/
function printDebug()
{
global $totaltime, $query_count, $show_queries, $query_log;
$ThisPage = $_SERVER['PHP_SELF'];
//变量调试信息 20070421
$variable_log = "本页得到的_GET变量有:\n" . print_array($_GET);
$variable_log .= "本页得到的_POST变量有:\n" . print_array($_POST);
$variable_log .= "本页得到的_COOKIE变量有:\n" . print_array($_COOKIE);
$variable_log .= "本页得到的_SESSION变量有:\n" . print_array(@$_SESSION);
$variable_log .= "HTTP头文件:\n" . print_array(getallheaders());
//
return "当前页面为:{$ThisPage} [<a href=\"javascript:history.go(0);\">刷新该页面</a>]\n\t <script language=\"javascript\" type=\"text/javascript\">\n\t\tfunction showdebug(span_show, span_source)\n\t\t{\n\t\t\tvar TheImg;\n\t\t\tspan_show\t= eval(span_show);\n\t \t\tspan_source\t= eval(span_source)\n\t\t\n\t\t\tif(span_show.style.display == \"none\")\n\t\t\t{\n\t\t\t\tspan_show.style.display = \"\";\n\t \t\t\tspan_source.innerHTML\t= \"<font color=\\'blue\\'>关闭</font>调试信息\"; \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tspan_show.style.display = \"none\";\n\t \t\t\tspan_source.innerHTML\t= \"<font color=\\'red\\'>打开</font>调试信息\"; \n\t\t\t}\n\t\t}\n\t </script>\n\t <span id=debug_source onClick=showdebug('debug_show','debug_source')><font color=\"red\">打开</font>调试信息</span><br>\n\t <!-- <span id=debug_source onClick=showdebug('debug_show','debug_source')><font color=\"blue\">关闭</font>调试信息</span><br> -->\n\t <div align=\"left\"><span id=debug_show style=\"display=none\">\n\t\t\t\t<textarea style='width=800;height=500' cols='100' rows='8'>{$query_log}{$variable_log}</textarea>\n\t </span>\n\t </div>\n\t ";
}
开发者ID:Zerolone,项目名称:mgroupware,代码行数:20,代码来源:mysql.inc.php
示例9: dev_dump
function dev_dump($argument, $heading = "", $dev = 1, $query_trigger = 0)
{
//print_r($_SERVER);
//allows the whole lot to be switched off
$all_off = 0;
//allows every dev dump encountered to be switched on
$all_on = 0;
if ($dev && !$all_off || $all_on) {
if (is_array($argument)) {
echo "<div style='width:95%; float:left; position:relative; background-color:#fff; z-index:1000000; margin-bottom:20px; padding:2%; border:1px solid #4242ff; color:#4242ff; border-radius:2px;'>";
if ($query_trigger) {
echo "<span class='dd_q_out full_screen_width bold'><strong>" . $heading . "</strong></span>";
} else {
echo "<span>ARRAY DUMP - <strong>" . $heading . "</strong></span><br/><br/>";
}
echo "<span class='dd_a_out full_screen_width'>";
print_array("", $argument);
echo "</span>";
echo "</div>";
} else {
if (is_numeric($argument)) {
echo "<div style='width:95%; float:left; position:relative; background-color:#fff; z-index:1000000; margin-bottom:20px; padding:2%;border:1px solid #bf42bf; color:#bf42bf; border-radius:2px;'>";
$type = 'NUMBER';
} else {
if (is_null($argument)) {
echo "<div style='width:95%; float:left; position:relative; background-color:#fff; z-index:1000000; margin-bottom:20px; padding:2%;border:1px solid #ff4242; color:#ff4242; border-radius:2px;'>";
$type = 'NULL';
} else {
echo "<div style='width:95%; float:left; position:relative; background-color:#fff; z-index:1000000; margin-bottom:20px; padding:2%;border:1px solid #428f42; color:#428f42; border-radius:2px;'>";
$type = 'STRING / OTHER';
}
}
echo "<span>" . $type . " DUMP - <strong>" . $heading . "</strong></span><br/><br/>";
echo "<span style='dd_v_out full_screen_width'>";
var_dump($argument);
echo "</span>";
echo "</div>";
}
echo "\n\n";
if (!$query_trigger) {
echo "<span style='width:100%;height:10px;float:left;'></span>";
}
}
}
开发者ID:toni-leigh,项目名称:core,代码行数:44,代码来源:development_helper.php
示例10: print_array
function print_array($data)
{
echo '[';
foreach ($data as $row) {
echo '{';
foreach (array_keys($row) as $key) {
if (isset($row[$key])) {
echo $key . ': ';
if (is_array($row[$key]) === FALSE) {
echo '"' . str_replace("\n", "\\n", $row[$key]) . '", ';
} else {
print_array($row[$key]);
echo ',';
}
}
}
echo '},';
}
echo ']';
}
开发者ID:siroj100,项目名称:hidupgue,代码行数:20,代码来源:jsonizer.php
示例11: print_array
function print_array($array, $offset_symbol = "|--", $offset = "", $parent = "")
{
if (!is_array($array)) {
echo "[{$array}] is not an array!<br />";
return;
}
reset($array);
switch ($array['type']) {
case "string":
printf("<li><div align=left class=string> - <span class=icon>[STRING]</span> <span class=title>[%s]</span> <span class=length>(%d)</span>: <span class=value>%s</span></div></li>", $parent, $array['strlen'], $array['value']);
break;
case "integer":
printf("<li><div align=left class=integer> - <span class=icon>[INT]</span> <span class=title>[%s]</span> <span class=length>(%d)</span>: <span class=value>%s</span></div></li>", $parent, $array['strlen'], $array['value']);
break;
case "list":
printf("<li><div align=left class=list> + <span class=icon>[LIST]</span> <span class=title>[%s]</span> <span class=length>(%d)</span></div>", $parent, $array['strlen']);
echo "<ul>";
print_array($array['value'], $offset_symbol, $offset . $offset_symbol);
echo "</ul></li>";
break;
case "dictionary":
printf("<li><div align=left class=dictionary> + <span class=icon>[DICT]</span> <span class=title>[%s]</span> <span class=length>(%d)</span></div>", $parent, $array['strlen']);
while (list($key, $val) = each($array)) {
if (is_array($val)) {
echo "<ul>";
print_array($val, $offset_symbol, $offset . $offset_symbol, $key);
echo "</ul>";
}
}
echo "</li>";
break;
default:
while (list($key, $val) = each($array)) {
if (is_array($val)) {
//echo $offset;
print_array($val, $offset_symbol, $offset, $key);
}
}
break;
}
}
开发者ID:CptTZ,项目名称:NexusPHP,代码行数:41,代码来源:torrent_info.php
示例12: mail
public function mail()
{
if (count($this->input->post()) > 0) {
$post = $this->input->post();
$post['propio'] = isset($post['propio']) ? $this->unRadio($post['propio']) : 'NO';
$post['franquicia'] = isset($post['franquicia']) ? $this->unRadio($post['franquicia']) : 'NO';
$post['sucursales'] = isset($post['sucursales']) ? $this->unRadio($post['sucursales']) : 'NO';
$post['nombreAgente'] = isset($post['nombreAgente']) ? $post['nombreAgente'] : 'No aplica';
$post['telAgente'] = isset($post['telAgente']) ? $post['telAgente'] : 'No aplica';
$post['emailAgente'] = isset($post['emailAgente']) ? $post['emailAgente'] : 'No aplica';
$data = ['intro' => ucfirst('huayacan58') . ' Email enviado desde: ' . base_url(), 'h1' => ucfirst('huayacan58'), 'p' => 'Email enviado desde: ' . base_url(), 'negocioTitle' => 'Datos del negocio', 'negocioP' => 'Nombre: ' . $post['nombreNegocio'] . '<br>' . 'Giro: ' . $post['giroNegocio'] . '<br>' . 'Interesado en: <br>' . $this->parseLocales($post['locales']) . '<br>' . 'es Propio: ' . $post['propio'] . '<br>' . 'es Franquicia: ' . $post['franquicia'] . '<br>' . 'tiene Sucursales: ' . $post['sucursales'] . '<br>', 'agenteTitle' => 'Datos del Agente', 'agenteP' => 'nombre: ' . $post['nombreAgente'] . '<br>' . 'tel: ' . $post['telAgente'] . '<br>' . 'email: <a target="_blank" href="mailto:' . $post['emailAgente'] . '">' . $post['emailAgente'] . '</a><br>', 'interesadoTitle' => 'Datos del interesado', 'interesadoP' => 'nombre: ' . $post['interesado'] . '<br>' . 'telefono: ' . $post['telefono'] . '<br>' . 'email : <a target="_blank" href="mailto:' . $post['email'] . '">' . $post['email'] . '</a><br>'];
$mensaje = $this->load->view('email/mensaje', $data, TRUE);
if ($this->mailer('[email protected]', 'Huayacan58.com', $mensaje)) {
redirect(base_url('enviado#contacto'), 'refresh');
} else {
print_array($this->mailer('[email protected]', 'Huayacan58.com', $mensaje), 1);
// <Ojo no dejar en produccion
}
} else {
redirect(base_url(), 'refresh');
}
}
开发者ID:virgenherrera,项目名称:huayacan58,代码行数:22,代码来源:Main.php
示例13: array
if ($user_id == 0) {
?>
<input type="text" id="txt_ver1" class="form-control" value="0" aria-describedby="basic-addon4" >
<?php
$_SESSION = array();
} else {
$_SESSION = array();
?>
<input type="text" id="txt_ver1" class="form-control" value="<?php
echo $user_id;
?>
" aria-describedby="basic-addon4" >
<?php
session_start();
$_SESSION["userid"] = $user_id;
print_array($_SESSION);
echo is_login();
}
}
break;
case "profile":
////Login
if (isset($_POST["pass_"]) && isset($_POST["id_"])) {
$user_id = change_pass($_POST["id_"], $_POST["pass_"]);
} else {
if (isset($_POST["oldpass_"]) && isset($_POST["id_"])) {
echo "entro aqui";
$user_id = check_old_pass($_POST["id_"], $_POST["oldpass_"]);
} else {
if (isset($_POST["name_"]) && isset($_POST["last_"]) && isset($_POST["mail_"]) && isset($_POST["id_"])) {
$user_id = change_data($_POST["id_"], $_POST["name_"], $_POST["last_"], $_POST["mail_"]);
开发者ID:eliascantoral,项目名称:guaflix,代码行数:31,代码来源:ajax.php
示例14: print_sub_header
$data1->prepare($strsql2);
$data1->execute($params);
$data1->commit();
print_sub_header('Inserted two rows and committed. They should exist...');
$data1->prepare($strsql);
$data1->execute(array(&$param1, &$param2));
$data = $data1->data_key_assoc('id');
print_array($data);
print_sub_header('Deleted the two rows that were added then rolled back.');
$strsql3 = 'delete from contacts where id IN (?, ?)';
$data1->prepare($strsql3);
$data1->execute(array(&$param1, &$param2));
$data1->rollback();
//$data1->commit();
print_sub_header('They should still be there...');
$data1->prepare($strsql);
$data1->execute(array(&$param1, &$param2));
$data = $data1->data_key_assoc('id');
print_array($data);
print_sub_header('Deleted the two rows that were added then committed.');
$data1->prepare($strsql3);
$data1->execute(array(&$param1, &$param2));
$data1->commit();
print_sub_header('They should gone.');
$data1->prepare($strsql);
$data1->execute(array(&$param1, &$param2));
$data = $data1->data_key_assoc('id');
print_array($data);
// Stop Benchmark
$cb->stop_timer();
$cb->print_results(true);
开发者ID:codifyllc,项目名称:phpopenfw,代码行数:31,代码来源:sqlsrv_tests.php
示例15: get_all_session_data
function get_all_session_data()
{
$ci =& get_instance();
return print_array($ci->session->all_userdata());
}
开发者ID:nwtug,项目名称:academia,代码行数:5,代码来源:user_helper.php
示例16: print_array
print_array($db1->error_message);
}
$sql = "select {$sk}.new_pkey('user_project','user_project_id') as newid;";
if (!$db1->sql_query($sql)) {
print_array($db1->error_message);
}
$newId = $db1->sql_fetchfield('newid');
$sql = "INSERT INTO {$sk}.user_project(user_project_id,user_id,project_id,usergroup_id) VALUES({$newId},{$newUserId},{$projectId},{$usergroupId})";
if (!$db1->sql_query($sql)) {
print_array($db1->error_message);
}
} else {
$sql = "select {$sk}.new_pkey('user_admin','user_id',100) as newid;";
if (!$db1->sql_query($sql)) {
print_array($db1->error_message);
}
$newUserId = $db1->sql_fetchfield('newid');
$sql = "INSERT INTO {$sk}.user_admin(user_id,username,pwd,admintype_id) VALUES({$newUserId},'{$username}','{$pwd}',2)";
if (!$db1->sql_query($sql)) {
print_array($db1->error_message);
}
$sql = "select {$sk}.new_pkey('user_project','user_project_id') as newid;";
if (!$db1->sql_query($sql)) {
print_array($db1->error_message);
}
$newId = $db1->sql_fetchfield('newid');
$sql = "INSERT INTO {$sk}.user_project(user_project_id,user_id,project_id,usergroup_id) VALUES({$newId},{$newUserId},{$projectId},2)";
if (!$db1->sql_query($sql)) {
print_array($db1->error_message);
}
}
开发者ID:mamogmx,项目名称:praticaweb-alghero,代码行数:31,代码来源:db.gisclientuser.php
示例17: unset
unset($_SESSION["ADD_NEW"]);
?>
<FORM id="stati" name="utenti" method="post" action="<?php
echo $formaction;
?>
">
<!-- <<<<<<<<<<<<<<<<<<<<< MODALITA' FORM IN EDITING >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>--->
<TABLE cellPadding=0 cellspacing=0 border=0 class="stiletabella" width="75%">
<tr>
<td>
<!-- contenuto-->
<?php
if ($id) {
print_array($Errors);
if ($Errors) {
$tabella->set_errors($Errors);
}
if (!count($Errors)) {
$tabella->set_dati("id={$id}");
} else {
$tabella->set_dati($_POST);
}
}
$tabella->edita();
?>
<!-- fine contenuto-->
</td>
</tr>
</TABLE>
开发者ID:mamogmx,项目名称:praticaweb-alghero,代码行数:31,代码来源:pe.e_stati.php
示例18: render
public function render()
{
//-------------------------------------------------------------
// No Render?
//-------------------------------------------------------------
if ($this->get_data('no-render') || defined('POFW_SKIP_RENDER') && POFW_SKIP_RENDER) {
return true;
}
//-------------------------------------------------------------
// JavaScript / CSS Add-in Files
//-------------------------------------------------------------
if (!empty($this->js_files)) {
$this->set_data('js_files', $this->js_files);
}
if (!empty($this->css_files)) {
$this->set_data('css_files', $this->css_files);
}
//-------------------------------------------------------------
// Escape Data (or not)
//-------------------------------------------------------------
if ($this->data_format == 'xml') {
foreach ($this->data as $dkey => &$dval) {
if (!isset($this->no_escape_elements[$dkey])) {
$dval = xml_escape_array($dval);
}
}
}
//-------------------------------------------------------------
// Create Data
//-------------------------------------------------------------
if ($this->data_format == 'xml') {
$data = array2xml($this->root_node, $this->data);
} else {
if ($this->data_format == 'json') {
$data = json_encode($this->data);
} else {
$data = $this->data;
}
}
//-------------------------------------------------------------
// Output
//-------------------------------------------------------------
if ($this->show_data_only) {
if (is_array($data)) {
print_array($data);
} else {
print $data;
}
return true;
} else {
$render_function = $this->get_data('render-function');
//----------------------------------------------------
// XML
//----------------------------------------------------
if ($this->data_format == 'xml') {
if ($render_function) {
return $render_function($data, $this->template);
} else {
if (file_exists($this->template)) {
return xml_transform($data, $this->template);
} else {
if (empty($this->template)) {
print "No template file has been specified.";
} else {
print "Invalid template file specified.";
}
}
}
} else {
if ($render_function) {
return $render_function($data, $this->template);
} else {
print "No valid render function was specified.";
}
}
}
return false;
}
开发者ID:codifyllc,项目名称:phpopenfw,代码行数:78,代码来源:page.class.php
示例19: check_by_filename
function check_by_filename($file = '', $sort = 'DESC')
{
if ($file == '') {
return NULL;
} else {
$data = array('trash' => 'n', 'fileurl' => $file);
//$this->output->cache(60); // Will expire in 60 minutes
$query = $this->db->select()->from($this->_tablename)->where($data)->order_by($this->_primary_key, $sort)->get();
print_array($this->db->last_query());
if ($query->num_rows() > 0) {
foreach ($query->result() as $row) {
return $row->id;
}
} else {
return FALSE;
}
}
}
开发者ID:rmuyinda,项目名称:dms-1,代码行数:18,代码来源:MY_Model.php
示例20: IN
$setup = true;
break;
case 'db2':
$strsql0 = 'select * from contacts where id IN (?, ?, ?, ?)';
$params = array(1, 2, 3, 4);
$cols = array(0, 'ID:FIRST_NAME', 'ID', 'FIRST_NAME:CITY', 'FIRST_NAME');
$setup = true;
break;
case 'sqlsrv':
$strsql0 = 'select * from contacts where id IN (?, ?, ?, ?)';
$params = array(1, 2, 3, 4);
$cols = array(0, 'id:first_name', 'id', 'first_name:city', 'first_name');
$setup = true;
break;
}
//*****************************************************
// Are We Setup? Run Tests.
//*****************************************************
if ($setup) {
//print_array($cols);
print_array(qdb_row($data_source, $strsql0, $cols[0], false, $params));
print qdb_row($data_source, $strsql0, '3', $cols[1], $params);
print_array(qdb_row($data_source, $strsql0, '3', $cols[2], $params));
print qdb_row($data_source, $strsql0, 'Chris', $cols[3], $params);
print_array(qdb_row($data_source, $strsql0, 'Chris', $cols[4], $params));
} else {
print div($no_setup_msg, array('class' => 'message_box no_setup'));
}
} else {
print div($no_bind_msg, array('class' => 'message_box notice'));
}
开发者ID:codifyllc,项目名称:phpopenfw,代码行数:31,代码来源:qdb_row.inc.php
注:本文中的print_array函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论