1:我觉得不加字段实现地可能性不大
2:
因为$_SESSION["xxx"]是全局变量,所以不能用这个方法来实现,例如:
function destroy_foo() {
global $foo;
unset($foo);
}
$foo = 'bar';
destroy_foo();
echo $foo;
上面地echo语句返回地是:
bar
浅妄薄见,望与斟酌
2:
因为$_SESSION["xxx"]是全局变量,所以不能用这个方法来实现,例如:
function destroy_foo() {
global $foo;
unset($foo);
}
$foo = 'bar';
destroy_foo();
echo $foo;
上面地echo语句返回地是:
bar
浅妄薄见,望与斟酌
解决方案 »
- 某些网站不提供搜索某些参数的界面,却可以直接在链接中输入参数是怎么回事?
- PHP正则问题请教各位高手
- php操作mysql数据库的时候 mysql_query()前必须要mysql_query(set names)的属性吗?
- 这个算strtotime("+1 month")的bug吗?
- 远程连接MYSQL 的PHP.INI配置问题
- 大家能否讨论一下对访问人数非常多的情况下怎么处理
- 迷惑。我在桌面能运行javascript,但我再apache,web目录下就不行。帮帮我谢谢在线等
- PHP与Perl有什么关系啊
- 你知道我在等你吗?online forever
- 怎样用php写发送email带html的email,谢谢!
- 请问哪里有学习做bbs的资料?
- 请问错在那里?header("location:gongqiu-add.php?username=$date['name']");
1. 如果加字段的话,字段里又存储什么值最简便呢?2.下面是我从php.net的在线文档中摘录的:
Example 3. Unregistering a variable with $_SESSION.
<?php
session_start();
// Use $HTTP_SESSION_VARS with PHP 4.0.6 or less
unset($_SESSION['count']);
?>3.追问一个问题,用户提交的文章存储于数据库中,查询时以表格显示,怎么避免表格被“撑爆”(就是超出设置的表宽,很难看)?
2.应该可以unset成功的。
3.用css控制:
在head标记之间加上:
<style>
td{word-break:break-all;}
</style>
如果想要比较智能一点的话,比如说下面两条新闻
a:江主席访美
b:访美实录
我想实现起来比较麻烦一些,这应该是认为分类的,而不是通过数据库查询能实现的吧2:to czlearner() :
你说的我也看到了,这应该是php的一个bug.
我的做法是:1:如果你的register_blobals开的话,先用session_unregister()然后再用unset(); 2:如果没有开,unset($GLOBALS['_SESSION']['foo']);
3:楼上说的是一种方法,我的方法是,只要在你的.php文件的代码中限定表格的宽度就可以了,文章内容就会自动的换行
1.如果不添字段的话,截取现在文章的标题的2/3做为查询条件,符合的就认为相关;2.为了向以后的PHP兼容^\_/^,坚持使用$_SESSION['foo'],如果register_globals开的话,先用$_SESSION['foo']=""然后再用unset;如果没有开,直接unset,已测试通过;3.css我不熟,能解释一下td{word-break:break-all;}的含义吗?
<table width=100 border>
<tr>
<td style="word-break:break-all">asadsfasdasfdasfdfasdfadsfadsfadsfasdfadsfadsfasfddfasdfasfdaffdassssssssssssssssssssssssssssssss</td>
</tr>
</table>绝对可以
Description
string wordwrap ( string str [, int width [, string break [, int cut]]])
Returns a string with str wrapped at the column number specified by the (optional) width parameter. The line is broken using the (optional) break parameter. wordwrap() will automatically wrap at column 75 and break using '\n' (newline) if width or break are not given. If the cut is set to 1, the string is always wrapped at the specified width. So if you have a word that is larger than the given width, it is broken apart. (See second example). Note: The optional cut parameter was added in PHP 4.0.3
Example 1. wordwrap() example$text = "The quick brown fox jumped over the lazy dog.";
$newtext = wordwrap( $text, 20 );echo "$newtext\n";
This example would display: The quick brown fox
jumped over the lazy dog.
我用英文也很好啊----直接加限定