经过一些搜索,我没有找到一个正确的方法来将列表中心<li>
固定到一个固定的宽度div
.
看看页面 ..它也不起作用!
我必须得到特定的页面内容(如第(12)页)
我用过:
<?php $id=47; $post = get_page($id); echo $post->post_content; ?>
Run Code Online (Sandbox Code Playgroud)
与qtranslate兼容的工作很好的execpt它返回法语和英语文本
但循环很好,只返回良好的语言版本
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<div id="post">
<?php the_content(); ?>
</div> <!-- .post -->
Run Code Online (Sandbox Code Playgroud)
所以问题......如何获取特定的页面内容以确保循环...
我试图让整个<head>
部分成为自己的包含文件.一个缺点是标题和描述以及关键字是相同的; 我无法弄清楚如何将参数传递给包含文件.
所以这是代码:
<?php include("header.php?header=aaaaaaaaaaaaaaaaaaaaa"); ?>
<body>
.....
..
.
Run Code Online (Sandbox Code Playgroud)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<link rel="shortcut icon" href="favicon.ico">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="Keywords" content=" <?php $_GET["header"]?> " >
<meta name="Description" content=" <?php $_GET["header"]?> " >
<title> <?php $_GET["header"]?> </title>
<link rel="stylesheet" type="text/css" href="reset.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
</head>
Run Code Online (Sandbox Code Playgroud)
显然这不起作用; 如何将参数传递给包含的文件?
有没有更好的方法用PHP输出数据到HTML页面?
如果我想用php中的一些var创建一个div,我会写这样的东西
print ('<div>'.$var.'</div>');
Run Code Online (Sandbox Code Playgroud)
要么
echo "'<div>'.$var.'</div>'";
Run Code Online (Sandbox Code Playgroud)
这样做的正确方法是什么?
或者更好的方法,填写$tempvar
并打印一次?像那样:
$tempvar = '<div>'.$var.'</div>'
print ($tempvar);
Run Code Online (Sandbox Code Playgroud)
事实上,在现实生活中,var将会充满更多!
我有这样一个数组:
array("a" => 2, "b" => 4, "c" => 2, "d" => 5, "e" => 6, "f" => 2)
Run Code Online (Sandbox Code Playgroud)
现在我想通过某种条件过滤该数组,只保留值等于2的元素,并删除值为2的所有元素.
所以我期望的结果数组是:
array("a" => 2, "c" => 2, "f" => 2)
Run Code Online (Sandbox Code Playgroud)
注意:我想保留原始数组中的键.
我怎么能用PHP做到这一点?任何内置功能?
我有两个javascript函数
function one () {
do something long... like writing jpgfile on disk
}
function two () {
do something fast... like show the file
}
Run Code Online (Sandbox Code Playgroud)
我这样称呼它(在jQuery中)
one ();
two ();
Run Code Online (Sandbox Code Playgroud)
因为函数二需要来自函数一的链接文件,我需要确保执行完成...所以在函数一的回调中获取函数二应该是技巧..但是如何做到这一点?
注意:我确实在这两个函数之间放了一个警告('aaa')让函数一个完成,并且它工作正常......当警报被注释(删除)时,任何东西都不再有效!
image naturalWidth返回零......就是这样,为什么?
var newimage = new Image();
newimage.src = 'retouche-hr' + newlinkimage.substring(14,17) + '-a.jpg';
var width = newimage.naturalWidth;
alert (width);
Run Code Online (Sandbox Code Playgroud)
帮助,我不知道为什么!
***那道路很好,图像显示出来!
我必须在MySQL数据库上用PHP做一些数据库请求.
问题:什么是最好的(最简单的)框架来完成正确的CRUD(创建读取更新删除)?
我还必须填充数据库,这是一个很好的工具.我认识的唯一一个是SqlMyAdmin,看起来并不好看.在线工具会很棒.
您的经验很有价值:告诉我您使用了什么以及为什么?
我看了看CodeIgniter,看起来不错,你觉得怎么样......矫枉过正?
这是html代码:
<div id="popup" class="popup_block" >
<img src="images/PUB-histRIRE.jpg" alt="popup" />
</div>
Run Code Online (Sandbox Code Playgroud)
和脚本:
<script type="text/javascript">
$(document).ready(function(){
popWidth = 690;
popHeight = 550;
popID = 'popup';
var popMargTop = popHeight / 2;
var popMargLeft = popWidth / 2;
//Apply Margin to Popup
$('#' + popID).css({
'width': popWidth,
'height': popHeight,
'margin-top' : -popMargTop,
'margin-left' : -popMargLeft,
'visibility' : 'visible'
});
//Fade in Background
$('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
$('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer
//Close …
Run Code Online (Sandbox Code Playgroud)