truncating search results

    Date: 06/04/05 (PHP Community)    Keywords: no keywords

    does anyone have any ideas on using the substr() (or some similar) function, but avoiding fragmenting words? if you do:

    $string = "jonathan's craving peanutbutter sandwiches";
    $string = substr($string, 0, 20);


    you get $string == "jonathan's craving pe"

    what i'd like to end up with is just "jonathan's craving"

    Source: http://www.livejournal.com/community/php/304348.html

« A really stupid logical... || help with mysql functions... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home