本文整理汇总了PHP中Articles::limit_text方法的典型用法代码示例。如果您正苦于以下问题:PHP Articles::limit_text方法的具体用法?PHP Articles::limit_text怎么用?PHP Articles::limit_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Articles
的用法示例。
在下文中一共展示了Articles::limit_text方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
<div class="table-responsive" id="tablelist">
<table class="table">
<thead>
<tr>
<th>Title</th>
<!-- <th>Content</th>-->
<th>Category</th>
<th>Edit</th>
</tr>
</thead>
<tbody>
<?php
if ($result != "No articles") {
while ($row = $result->fetch_assoc()) {
$content = $articles->limit_text($row['article_content'], 300);
echo '<tr>';
echo "<td>" . $row['article_name'] . "</td>";
// echo "<td>".$content."</td>";
echo "<td>" . $row['category_name'] . "</td>";
echo "<td><a target='_blank' href='articleview.php?aid=" . $row['article_id'] . "'' class='btn btn-success'><span class='glyphicon glyphicon-folder-open'></span></a> <a target='_blank' href='articleupdate.php?aid=" . $row['article_id'] . "' class='btn btn-success'><span class='glyphicon glyphicon-pencil'></span></a> <button class='btn btn-success' id='" . $row['article_id'] . "' onclick='req(id)'><span id='delete'class='glyphicon glyphicon-trash'></span></button></td>";
echo '</tr>';
}
} else {
echo "<tr><p> Currently User Have Not Any Article</p></tr>";
}
?>
</tbody>
</table>
</div>
</div>
示例2: ucwords
$count = 0;
}
?>
<div class="col-sm-4">
<div class="panel panel-primary">
<div class="panel-heading home links"><?php
echo $row['article_name'];
?>
</div>
<div class="panel-body"><img src="articleimage/<?php
echo $row['img'];
?>
" class="img-responsive img-circle" style="width:100%" alt="Image">
<p> <?php
$aid = $row['url'];
echo $view->limit_text($row['article_content']) . " " . "<a href='{$aid}'>read more...</a>";
//echo $row['article_content'];
?>
</p>
</div>
<div class="panel-footer"><p> Post by <?php
echo ucwords($row['u_fname']) . " " . ucwords($row['u_lname']) . "," . $row['dates'];
?>
.
<br><span class="label label-danger"><?php
echo $row['category_name'];
?>
</span></p></div>
</div>
</div>