This is not a question reguarding DMZ... sorry to post it here... but you are my best friends over the internet ! the people who teach me how to program !
Well..
I am making a website and in its front page I want to put the last 3 articles.
The problem is that I do not want to put the full content of the article, I just want to put the first 100 characters of its content !
How to do that in PHP ?
controller:
Code:
$a = new Article();
$a->order_by('id', "DESC")->get(3);
$data['articles'] = $a->all;
view:
Code:
foreach($articles as $article) {
echo $article->created;
echo $article->title;
echo $article->content;
}
Is there a way to make the "echo $article->content" only show 100 characters ?