Re: string function
| From: | jeremy brand | Date: | Fri, 18 Aug 2000 07:04:21 +0000 |
| Subject: | Re: string function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-12423@lists.php.net to get a copy of this message | ||
On Fri, 18 Aug 2000, TOM wrote:
> Is there any string function can read the first few character of a word:
>
> For e.g
> $string = "2000008";
>
> and I want to read the first 4 characters of the string and display on the
> screen.
print substr($string,0,4);
substr() takes a string and returns the number of units (4) starting
from position (0).
-jeremy brand
_______________________________________________________________________
GnuPG Fingerprint: 9F5E 95E0 1CC2 E054 84EA 6099 8ACD 9DBA D2C0 5EA9
_ http://www.jeremybrand.com/jeremy/brand/jeremy_brand.html
for more __