A
A
Azat Vadjipov2016-01-28 17:17:18
PHP
Azat Vadjipov, 2016-01-28 17:17:18

How to display part of the article on the screen?

Hello! I'm just new to PHP and need your help. I wrote a blog on lessons on the Internet. And in the lesson on the main page, only the output of the title of the article and the date of publication was explained. How to conclude an article, well, let's say, how on Habré? That is, part of the article (some number of characters), and then "Read completely ...".
The name of my database is cms, the table is articles, the article number is id, the content of the article is content
Thank you in advance!
UPD: still have a question about CSS. How can I make an outline of some object (most likely with the help of border) and fill this thickness with some kind of picture on the background.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wol_fi, 2016-01-28
@MrTweak

How to conclude an article, well, let's say, how on Habré? That is, part of the article (some number of characters), and then "Read completely ...".

Apply this function php.net/manual/ru/function.mb-substr.php to the content and output what you get.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question