![]() |
|
| Domain Name Sales | Domain Software | Calculate UK Domain Drop Dates | Domain Lists | SedoPro Code | Domains For Sale | NameDrive | Domain Parking |
| |||||||
| Home | Register | Domain Auctions [1] | FAQ | Membership Upgrade | Featured Domain Listing | Mark Forums Read | Domain Classified | Chat Room |
| Website Design Discuss webmastering issues or ideas to help you design websites to make the most of your domain portfolio |
![]() |
| | Thread Tools | Display Modes |
| | #1 |
![]() | PHP help Can any PHP geniuses help me out here, here is what I want to do: if length of $string > 50 then $string = first 50 characters + "....." Thanking you kindly Grant |
| | |
| | #2 |
![]() | $string = (strlen($string)>50) ? substr($string,0,50).'…' : $string; Jee |
| | |
| | #3 |
![]() | If you're creating an excerpt then that'll sometimes cut you off in the middle of words. You can avoid this by trimming the output of the above and removing anything between the last word boundary and the end of the string. Code: $string = preg_replace('/\b.*$/', '', $string);
|
| | |
| | #4 |
![]() | Thanks for the assistance chaps, very helpful and much appreciated. Grant |
| | |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Domain Name Community | Replies | Last Post |
| PHP Web Developer in need of work | bboystu | Scripts and Coding | 3 | 31-07-2008 10:17 AM |
| SSI or PHP include? | purg | Search Engine Optimisation | 4 | 10-11-2006 09:44 PM |
| PHP Link Directory - Free Templates | admin | Website Design | 0 | 18-05-2006 01:25 PM |
| PHP Coders? | storebuilder | Website Design | 10 | 23-02-2006 12:24 PM |