- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前正在使用 PHP API 来显示来自 MySQL 数据库的信息,但进展不太顺利。我注意到当您通过 API 查看信息时会显示该信息(例如: https://epicmc.us/api.php?task=total ),但它根本不会显示在我的页面上。我确信 API 正在工作,所以我想我在 HTML 格式中做错了什么,有什么想法吗?
这是我的 API 代码:
编辑:出于安全考虑,API 已被撤回。
这是我将此信息转发到的页面:
<!DOCTYPE html>
<head>
<link rel="icon"
type="image/png"
href="https://minepic.org/update/<?php echo $_GET['player']; ?>">
<link rel="apple-touch-icon"
type="image/png"
href="https://minepic.org/update/<?php echo $_GET['player']; ?>">
<title><?php echo "EPICMC - "; if(empty($_GET['player'])){ echo "STATS";} else { echo $_GET['player']; }?></title>
<meta name="apple-mobile-web-app-title" content="<?php echo ""; if(empty($_GET['player'])){ echo "STATS";} else { echo $_GET['player']; }?>">
<meta name=viewport content="width=device-width, user-scalable=no">
<link href="https://fonts.googleapis.com/css?family=Days+One&text=EPICM" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Numans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://epicmc.us/dist/css/ripples.min.css" rel="stylesheet">
<link href="https://epicmc.us/dist/css/material-wfont.min.css" rel="stylesheet">
<style>
body { font-family: 'Numans', sans-serif; background: #eee; -webkit-font-smoothing: antialiased; }
p {
font-family: 'Numans', sans-serif;
font-size: 13px;
font-weight: lighter;
text-align: center;
display: inline;
}
h5 {
font-family: 'Numans', sans-serif;
font-size: 18px;
font-weight: lighter;
color: #636363;
text-align: center;
margin-bottom: 35px;
text-transform: uppercase;
margin-bottom: 50px;
}
h2 {
font-family: 'Numans', sans-serif;
font-size: 28px;
font-weight: lighter;
color: #636363;
text-align: center;
margin-bottom: 35px;
text-transform: uppercase;
}
.logo { font-family: 'Days One', sans-serif; font-weight: lighter; font-size: 48px; margin-bottom: 35px; text-align: center; margin-top: 58px;}
a:link,a:visited,a:hover,a:active { color: #636363; text-decoration: none; }
#stats {
width: 300px;
margin: 4em auto;
padding: 3em 2em 2em 2em;
background: #fafafa;
border: 1px solid #ebebeb;
box-shadow: rgba(0,0,0,0.14902) 0px 1px 1px 0px,rgba(0,0,0,0.09804) 0px 1px 2px 0px;
}
.alert-info, .alert-danger, .alert-warning, .alert-success { margin-top: -20px; background-color: #323232; }
td, th{
width: 33.33%;
border-style: solid;
border-color: #323232;
border-width: 1px;
background-color: #f6f6f6;
}
.fa-stack {
color: #00aa00;
font-size: 11px;
margin-left: 4px;
margin-right: 4px;
}
.fa-exclamation-triangle {
color: #aa0000;
margin-left: 3px;
margin-right: 3px;
}
.fa-inverse {
text-shadow: 1.5px 1.5px #007600;
font-size: 11px;
}
#registered {
margin-top: -25px;
margin-bottom: 30px;
}
.avatar {
width: 80px;
height: 80px;
margin-bottom: 25px;
pointer-events: none;
}
.media img+span.badge {
position: relative;
top: -8px;
left: 8px;
}
</style>
</head>
<body>
<div class="navbar navbar-inverse">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-warning-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="https://epicmc.us/">EPICMC</a>
</div>
<div class="navbar-collapse collapse navbar-warning-collapse">
<ul class="nav navbar-nav">
<li><a href="https://epicmc.us/network.php">NETWORK</a></li>
<li><a href="https://epicmc.us/plugins.php">PLUGINS</a></li>
<li><a href="https://twitter.com/EPICMC_US" target="_blank">TWITTER</a></li>
</ul>
<form class="navbar-form navbar-left" action="stats.php" method="GET">
<input type="text" name="player" class="form-control col-lg-8" placeholder="USERNAME">
</form>
</li>
</ul>
</div>
</div>
<center>
<div class="bs-component">
<div class="alert alert alert-danger">
THIS IS CURRENTLY A BETA FEATURE. WE ARE CONSTANTLY IMPROVING UPON IT!
</div>
</center>
<h1 class="logo"><a href="https://epicmc.us">EPIC<font color="#00aa00">MC</font></a></h1>
<div id="stats">
<?php
date_default_timezone_set('Europe/Paris');
//echo '<center><img class="avatar" src="https://minepic.org/update/';
//echo $_GET['player'];
//echo '"></center>';
$get_player = $_GET['player'];
$remote_api = file_get_contents('https://epicmc.us/api.php?task=view&player='.$get_player.'');
$remote_job = json_decode($remote_api);
$remote_api1 = file_get_contents('https://epicmc.us/api.php?task=viewstats&player='.$get_player.'');
$remote_job1 = json_decode($remote_api1);
// $now = time(); // or your date as well`enter code here`
if ($get_player){
echo '<center><img class="avatar" src="https://minepic.org/update/';
echo $_GET['player'];
echo '"></center>';
echo '<h5>';
echo $get_player;
if(substr($remote_job->verified,0,2) == 1){
echo '<span title="VERIFIED PLAYER" class="fa fa-stack fa-lg"><i class="fa fa-certificate fa-stack-2x"></i><i class="fa fa-check fa-stack-1x fa-inverse"></i></span>'
;
}
echo '</h5>';
echo '<div id="registered">';
echo '<center><p>REGISTERED</p> ';
echo '<p>';
if(empty($remote_job)){ echo "--";} else {
//echo substr($remote_job->registered,0,50);
$date1 = new DateTime('NOW');
$date2 = new DateTime($remote_job->registered);
$difference = $date1->diff($date2)->days;
//echo $difference;
if ($difference == 0){
if ($date1->diff($date2)->h == 0){
echo $date1->diff($date2)->i;
echo " MINUTES AGO";
} else {
echo $date11->diff($date2)->h;
echo " HOURS AGO";
}
}
if ($difference == 1){
echo $difference;
echo " DAY AGO";
}
if ($difference == 2){
echo $difference;
echo " DAYS AGO";
}
if ($difference == 3){
echo $difference;
echo " DAYS AGO";
}
if ($difference == 4){
echo $difference;
echo " DAYS AGO";
}
if ($difference == 5){
echo $difference;
echo " DAYS AGO";
}
if ($difference == 6){
echo $difference;
echo " DAYS AGO";
}
if ($difference == 7){
//echo $difference;
echo "1 WEEK AGO";
}
if ($difference > 7 && $difference < 14){
echo $difference;
echo " DAYS AGO";
}
if ($difference == 14){
//echo $difference;
echo "2 WEEKS AGO";
}
if ($difference > 14){
echo $difference;
echo " DAYS AGO";
}
}
echo '</p><br>';
echo '<p>LAST SEEN</p> ';
?>
<?php
echo '<p>';
if(empty($remote_job)){ echo "--";} else {
//echo substr($remote_job->lastlogin,0,50);
$date11 = new DateTime('NOW');
$date22 = new DateTime($remote_job->lastlogin);
$difference11 = $date11->diff($date22)->days;
$difference111 = $date11->diff($date22);
if ($difference11 == 0){
if ($date11->diff($date22)->h == 0){
echo $date11->diff($date22)->i;
echo " MINUTES AGO";
} else {
echo $date11->diff($date22)->h;
echo " HOURS AGO";
}
}
if ($difference11 == 1){
echo $difference11;
echo " DAY AGO";
}
if ($difference11 == 2){
echo $difference11;
echo " DAYS AGO";
}
if ($difference11 == 3){
echo $difference11;
echo " DAYS AGO";
}
if ($difference11 == 4){
echo $difference11;
echo " DAYS AGO";
}
if ($difference11 == 5){
echo $difference11;
echo " DAYS AGO";
}
if ($difference11 == 6){
echo $difference11;
echo " DAYS AGO";
}
if ($difference11 == 7){
//echo $difference11;
echo "1 WEEK AGO";
}
if ($difference11 > 7 && $difference11 < 14){
echo $difference11;
echo " DAYS AGO";
}
if ($difference11 == 14){
//echo $difference11;
echo "2 WEEKS AGO";
}
//print_r ($difference111);
}
echo '</p></center>';
echo '</div>';
?>
<div id="tables">
<table style="width: 100%; text-align: center;">
<tr>
<td>
<p>KILLS</p>
</td>
<td>
<p>DEATHS</p>
</td>
<td>
<p>RATIO</p>
</td>
</tr>
<tr>
<td><?php if(empty($remote_job1)){ echo "--";} else { echo substr($remote_job1->kills,0,50); } ?></td>
<td><?php if(empty($remote_job1)){ echo "--";} else { echo substr($remote_job1->deaths,0,50); } ?></td>
<td><?php if(empty($remote_job1)){ echo "--";} else { echo substr($remote_job1->ratio,0,50); } ?></td>
</tr>
</table>
<br>
<table style="width: 100%; text-align: center;">
<tr>
<td>
<p>JOINS</p>
</td>
<td>
<p>QUITS</p>
</td>
<td>
<p>KICKED</p>
</tr>
<tr>
<td><?php if(empty($remote_job1)){ echo "--";} else { echo substr($remote_job1->joins,0,50); } ?></td>
<td><?php if(empty($remote_job1)){ echo "--";} else { echo substr($remote_job1->quits,0,50); } ?></td>
<td><?php if(empty($remote_job1)){ echo "--";} else { echo substr($remote_job1->kicked,0,50); } ?></td>
</tr>
</table>
<br>
<table style="width: 100%; text-align: center;">
<tr>
<td>
<p>PLACES</p>
</td>
<td>
<p>BREAKS</p>
</td>
</tr>
<tr>
<td><?php if(empty($remote_job1)){ echo "--";} else { echo substr($remote_job1->places,0,50); } ?></td>
<td><?php if(empty($remote_job1)){ echo "--";} else { echo substr($remote_job1->breaks,0,50); } ?></td>
</tr>
</table>
<br>
<?php
if($remote_job->verified == 1){
echo '';
} else {
echo '<center><small><i class="fa fa-exclamation-triangle"></i><a href="mailto:report@epicmc.us?subject=Impersonation Report Username: ';
echo $get_player;
echo '&body=Please be as detailed as possible! Username: ';
echo $get_player;
echo '">REPORT IMPERSONATION</a></small></center>';
}
}
else {
echo '<h5>PLEASE ENTER A USERNAME SO WE CAN DISPLAY THE STATS!</h5>';
}
?>
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<script src="https://epicmc.us/dist/js/textbox.js"></script>
<script src="https://epicmc.us/dist/js/ripples.min.js"></script>
<script src="https://epicmc.us/dist/js/material.min.js"></script>
<script>
$(document).ready(function() {
$.material.init();
});
</script>
</body>
</html>
最佳答案
清理了缩进和日期逻辑,并更改了一些变量名称以使其更具描述性。如果没有页面输出,调试有点困难,但也许有些东西已经修复了。我还修复了一个 undefined variable 拼写错误,这可能导致了您的问题。
<?php
// error_reporting(E_ALL);
?>
<!DOCTYPE html>
<head>
<link rel="icon"
type="image/png"
href="https://minepic.org/update/<?php echo $_GET['player']; ?>">
<link rel="apple-touch-icon"
type="image/png"
href="https://minepic.org/update/<?php echo $_GET['player']; ?>">
<title><?php echo "EPICMC - "; if(empty($_GET['player'])){ echo "STATS";} else { echo $_GET['player']; }?></title>
<meta name="apple-mobile-web-app-title" content="<?php echo ""; if(empty($_GET['player'])){ echo "STATS";} else { echo $_GET['player']; }?>">
<meta name=viewport content="width=device-width, user-scalable=no">
<link href="https://fonts.googleapis.com/css?family=Days+One&text=EPICM" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Numans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://epicmc.us/dist/css/ripples.min.css" rel="stylesheet">
<link href="https://epicmc.us/dist/css/material-wfont.min.css" rel="stylesheet">
<style>
body {
font-family: 'Numans', sans-serif;
background: #eee;
-webkit-font-smoothing: antialiased;
}
p {
font-family: 'Numans', sans-serif;
font-size: 13px;
font-weight: lighter;
text-align: center;
display: inline;
}
h5 {
font-family: 'Numans', sans-serif;
font-size: 18px;
font-weight: lighter;
color: #636363;
text-align: center;
margin-bottom: 35px;
text-transform: uppercase;
margin-bottom: 50px;
}
h2 {
font-family: 'Numans', sans-serif;
font-size: 28px;
font-weight: lighter;
color: #636363;
text-align: center;
margin-bottom: 35px;
text-transform: uppercase;
}
.logo {
font-family: 'Days One', sans-serif;
font-weight: lighter;
font-size: 48px;
margin-bottom: 35px;
text-align: center;
margin-top: 58px;
}
a:link,a:visited,a:hover,a:active {
color: #636363;
text-decoration: none;
}
#stats {
width: 300px;
margin: 4em auto;
padding: 3em 2em 2em 2em;
background: #fafafa;
border: 1px solid #ebebeb;
box-shadow: rgba(0,0,0,0.14902) 0px 1px 1px 0px,rgba(0,0,0,0.09804) 0px 1px 2px 0px;
}
.alert-info, .alert-danger, .alert-warning, .alert-success {
margin-top: -20px; background-color: #323232;
}
td, th {
width: 33.33%;
border-style: solid;
border-color: #323232;
border-width: 1px;
background-color: #f6f6f6;
}
.fa-stack {
color: #00aa00;
font-size: 11px;
margin-left: 4px;
margin-right: 4px;
}
.fa-exclamation-triangle {
color: #aa0000;
margin-left: 3px;
margin-right: 3px;
}
.fa-inverse {
text-shadow: 1.5px 1.5px #007600;
font-size: 11px;
}
#registered {
margin-top: -25px;
margin-bottom: 30px;
}
.avatar {
width: 80px;
height: 80px;
margin-bottom: 25px;
pointer-events: none;
}
.media img+span.badge {
position: relative;
top: -8px;
left: 8px;
}
</style>
</head>
<body>
<div class="navbar navbar-inverse">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-warning-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="https://epicmc.us/">EPICMC</a>
</div>
<div class="navbar-collapse collapse navbar-warning-collapse">
<ul class="nav navbar-nav">
<li><a href="https://epicmc.us/network.php">NETWORK</a></li>
<li><a href="https://epicmc.us/plugins.php">PLUGINS</a></li>
<li><a href="https://twitter.com/EPICMC_US" target="_blank">TWITTER</a></li>
</ul>
<form class="navbar-form navbar-left" action="stats.php" method="GET">
<input type="text" name="player" class="form-control col-lg-8" placeholder="USERNAME">
</form>
</li>
</ul>
</div>
</div>
<center>
<div class="bs-component">
<div class="alert alert alert-danger">
THIS IS CURRENTLY A BETA FEATURE. WE ARE CONSTANTLY IMPROVING UPON IT!
</div>
</div>
</center>
<h1 class="logo"><a href="https://epicmc.us">EPIC<font color="#00aa00">MC</font></a></h1>
<div id="stats">
<?php
function mcus_timeAgoString($dateInterval) {
$daysAgo = $dateInterval->days;
//echo $difference;
if ($daysAgo == 0){
if ($dateInterval->h == 0){
$diffStr = $dateInterval->i . " MINUTES AGO";
} else {
$diffStr = $dateInterval->h . " HOURS AGO";
}
} else {
if($daysAgo === 1) {
$diffStr = "1 DAY AGO";
} else if($daysAgo === 7) {
$diffStr = "1 WEEK AGO";
} else if($daysAgo === 14) {
$diffStr = "2 WEEKS AGO";
} else {
$diffStr = "$daysAgo DAYS AGO";
}
}
return $diffStr;
}
date_default_timezone_set('Europe/Paris');
//echo '<center><img class="avatar" src="https://minepic.org/update/';
//echo $_GET['player'];
//echo '"></center>';
$get_player = $_GET['player'];
$playerAccountInfoJSON = file_get_contents('https://epicmc.us/api.php?task=view&player='.$get_player.'');
// $playerAccountInfoJSON = '{"task":"view","registered":"12/23/2014","lastlogin":"01/03/2015 02:32 AM","verified":"1"}';
$playerAccountInfo = json_decode($playerAccountInfoJSON);
$playerStatsJSON = file_get_contents('https://epicmc.us/api.php?task=viewstats&player='.$get_player.'');
// $playerStatsJSON = '{"task":"viewstats","kills":"1","deaths":"1","ratio":"1","joins":"22","quits":"28","kicked":"5"} ';
$playerStats = json_decode($playerStatsJSON);
// var_dump($playerAccountInfo);
// var_dump($playerStats);
// $now = time(); // or your date as well`enter code here`
if ($get_player) {
echo '<center><img class="avatar" src="https://minepic.org/update/';
echo $_GET['player'];
echo '"></center>';
echo '<h5>';
echo $get_player;
if(!empty($playerAccountInfo->verified) && substr($playerAccountInfo->verified,0,2) == 1) {
echo '<span title="VERIFIED PLAYER" class="fa fa-stack fa-lg">'
. '<i class="fa fa-certificate fa-stack-2x"></i>'
. '<i class="fa fa-check fa-stack-1x fa-inverse"></i>'
. '</span>'
;
}
echo '</h5>';
echo '<div id="registered">';
echo '<center><p>REGISTERED</p> ';
echo '<p>';
if(empty($playerAccountInfo)) {
echo "--";
} else {
//echo substr($playerAccountInfo->registered,0,50);
$dtNow = new DateTime('NOW');
$dtReg = new DateTime($playerAccountInfo->registered);
$diRegToNow = $dtNow->diff($dtReg);
$daysSinceReg = $diRegToNow->days;
//echo $difference;
echo mcus_timeAgoString($diRegToNow);
}
echo '</p><br>';
echo '<p>LAST SEEN</p> ';
echo '<p>';
if(empty($playerAccountInfo)){
echo "--";
} else {
//echo substr($playerAccountInfo->lastlogin,0,50);
$dtNow = new DateTime('NOW');
$dtLastLogin = new DateTime($playerAccountInfo->lastlogin);
$diLastLoginToNow = $dtNow->diff($dtLastLogin);
echo mcus_timeAgoString($diLastLoginToNow);
}
echo '</p></center>';
echo '</div>';
?>
<div id="tables">
<table style="width: 100%; text-align: center;">
<tr>
<td>
<p>KILLS</p>
</td>
<td>
<p>DEATHS</p>
</td>
<td>
<p>RATIO</p>
</td>
</tr>
<tr>
<td><?php echo empty($playerStats->kills) ? "--" : substr($playerStats->kills, 0, 50); ?></td>
<td><?php echo empty($playerStats->deaths) ? "--" : substr($playerStats->deaths, 0, 50); ?></td>
<td><?php echo empty($playerStats->ratio) ? "--" : substr($playerStats->ratio, 0, 50); ?></td>
</tr>
</table>
<br>
<table style="width: 100%; text-align: center;">
<tr>
<td>
<p>JOINS</p>
</td>
<td>
<p>QUITS</p>
</td>
<td>
<p>KICKED</p>
</tr>
<tr>
<td><?php echo empty($playerStats->joins) ? "--" : substr($playerStats->joins, 0, 50); ?></td>
<td><?php echo empty($playerStats->quits) ? "--" : substr($playerStats->quits, 0, 50); ?></td>
<td><?php echo empty($playerStats->kicked) ? "--" : substr($playerStats->kicked, 0, 50); ?></td>
</tr>
</table>
<br>
<table style="width: 100%; text-align: center;">
<tr>
<td>
<p>PLACES</p>
</td>
<td>
<p>BREAKS</p>
</td>
</tr>
<tr>
<td><?php echo empty($playerStats->places) ? "--" : substr($playerStats->places,0,50); ?></td>
<td><?php echo empty($playerStats->breaks) ? "--" : substr($playerStats->breaks,0,50); ?></td>
</tr>
</table>
<br>
<?php
if(!empty($playerAccountInfo->verified) && $playerAccountInfo->verified == 1){
echo '';
} else {
echo '<center><small>'
. '<i class="fa fa-exclamation-triangle"></i>'
. '<a href="mailto:report@epicmc.us?subject=Impersonation Report Username: '
. $get_player
. '&body=Please be as detailed as possible! Username: '
. $get_player
. '">REPORT IMPERSONATION</a></small></center>'
;
}
} else {
echo '<h5>PLEASE ENTER A USERNAME SO WE CAN DISPLAY THE STATS!</h5>';
}
?>
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<script src="https://epicmc.us/dist/js/textbox.js"></script>
<script src="https://epicmc.us/dist/js/ripples.min.js"></script>
<script src="https://epicmc.us/dist/js/material.min.js"></script>
<script>
$(document).ready(function() {
$.material.init();
});
</script>
</body>
</html>
关于php - 使用 PHP API 显示 MySQL 信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27751840/
我在 JavaScript 文件中运行 PHP,例如...... var = '';). 我需要使用 JavaScript 来扫描字符串中的 PHP 定界符(打开和关闭 PHP 的 )。 我已经知道使
我希望能够做这样的事情: php --determine-oldest-supported-php-version test.php 并得到这个输出: 7.2 也就是说,php 二进制检查 test.
我正在开发一个目前不使用任何框架的大型 php 站点。我的大问题是,随着时间的推移慢慢尝试将框架融入应用程序是否可取,例如在创建的新部件和更新的旧部件中? 比如所有的页面都是直接通过url服务的,有几
下面是我的源代码,我想在同一页面顶部的另一个 php 脚本中使用位于底部 php 脚本的变量 $r1。我需要一个简单的解决方案来解决这个问题。我想在代码中存在的更新查询中使用该变量。 $name)
我正在制作一个网站,根据不同的情况进行大量 PHP 重定向。就像这样...... header("Location: somesite.com/redirectedpage.php"); 为了安全起见
我有一个旧网站,我的 php 标签从 因为短标签已经显示出安全问题,并且在未来的版本中将不被支持。 关于php - 如何避免在 php 文件中写入
我有一个用 PHP 编写的配置文件,如下所示, 所以我想用PHP开发一个接口(interface),它可以编辑文件值,如$WEBPATH , $ACCOUNTPATH和 const值(value)观
我试图制作一个登录页面来学习基本的PHP,首先我希望我的独立PHP文件存储HTML文件的输入(带有表单),但是当我按下按钮时(触发POST到PHP脚本) )我一直收到令人不愉快的错误。 我已经搜索了S
我正在寻找一种让 PHP 以一种形式打印任意数组的方法,我可以将该数组作为赋值包含在我的(测试)代码中。 print_r 产生例如: Array ( [0] => qsr-part:1285 [1]
这个问题已经有答案了: 已关闭11 年前。 Possible Duplicate: What is the max key size for an array in PHP? 正如标题所说,我想知道
我正在寻找一种让 PHP 以一种形式打印任意数组的方法,我可以将该数组作为赋值包含在我的(测试)代码中。 print_r 产生例如: Array ( [0] => qsr-part:1285 [1]
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 9 年前。 Improve this ques
我在 MySQL 数据库中有一个表,其中存储餐厅在每个工作日和时段提供的菜单。 表结构如下: i_type i_name i_cost i_day i_start i_
我有两页。 test1.php 和 test2.php。 我想做的就是在 test1.php 上点击提交,并将 test2.php 显示在 div 中。这实际上工作正常,但我需要向 test2.php
我得到了这个代码。我想通过textarea更新mysql。我在textarea中回显我的MySQL,但我不知道如何更新它,我应该把所有东西都放进去吗,因为_GET模式没有给我任何东西,我也尝试_GET
首先,我是 php 的新手,所以我仍在努力学习。我在 Wordpress 上创建了一个表单,我想将值插入一个表(data_test 表,我已经管理了),然后从 data_test 表中获取所有列(id
我有以下函数可以清理用户或网址的输入: function SanitizeString($var) { $var=stripslashes($var); $va
我有一个 html 页面,它使用 php 文件查询数据库,然后让用户登录,否则拒绝访问。我遇到的问题是它只是重定向到 php 文件的 url,并且从不对发生的事情提供反馈。这是我第一次使用 html、
我有一个页面充满了指向 pdf 的链接,我想跟踪哪些链接被单击。我以为我可以做如下的事情,但遇到了问题: query($sql); if($result){
我正在使用 从外部文本文件加载 HTML/PHP 代码 $f = fopen($filename, "r"); while ($line = fgets($f, 4096)) { print $l
我是一名优秀的程序员,十分优秀!