如何用php实现嵌套回复

WBOY
Release: 2016-06-06 20:52:27
Original
1003 people have browsed it

像wordpress的嵌套回复如何实现?是用递归么?最好有实例代码。谢谢。

回复内容:

像wordpress的嵌套回复如何实现?是用递归么?最好有实例代码。谢谢。

我这里就不说数据库的写入和读取评论的问题了,其实也就是循环读取的问题罢了。
这里说说CSS部分,其实很简单,母评论写个id="parent",然后所有的子评论都有同一个id="children",然后对子评论设置margin或者padding什么的就会有那种一级一级往下减的感觉了~

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template