RE: [PHP] Get just first 200 characters of field?
| From: | Mark Roedel | Date: | Wed, 18 Oct 2000 14:17:22 +0000 |
| Subject: | RE: [PHP] Get just first 200 characters of field? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-3757@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: James Montz [mailto:jmontz@ncn.net]
> Sent: Wednesday, October 18, 2000 9:01 AM
> To: php-db@lists.php.net; php-general@lists.php.net
> Subject: [PHP] Get just first 200 characters of field?
>
>
> Im working on my own news managment system for my web site, and I
> would like to be able to post on the main page the article header,
> and just the first 200 or so characters of the actual content of
> the article.
>
> How can this be done? Using PHP3 and MySQL? Is there a specific
> PHP or MySQL function that would accomplish this?
Using PHP:
substr()
http://php.net/substr
Using MySQL:
left() or substring()
http://www.mysql.com/documentation/mysql/commented/manual.php?section=String
_functions
---
Mark Roedel | "Blessed is he who has learned to laugh
Systems Programmer | at himself, for he shall never cease
LeTourneau University | to be entertained."
Longview, Texas, USA | -- John Powell