Profile
Achievement
DaveChild's Recent SnippetsTagged php
- All /
« Prev 1 Next »
This function will add soft hyphens after every 3rd character in words of over 10 characters. It will not leave fewer than three characters following a soft hyphen.
Known bugs: Adds soft hyphens to URLs and within HTML tags.
0
732
posted 15 years ago by DaveChild
This snippet returns a link to twitter for the user to tweet the current page. URL is TinyURLed automatically (and tinyurls are cached indefinitely in assets/cache/tweetthis.txt).
Simply paste code into a new snippet called "TweetThis". Call it li...
3
838
posted 15 years ago by DaveChild
If reading email from a POP box with PHP, you can use this to strip out signatures (ones that are delimited with the proper '--' notation). It will only strip the last signature of an email, in case someone enters a '--' intentionally elsewhere.
0
856
posted 15 years ago by DaveChild
Pass in text and the maximum allowable length and this snippet will return as many full sentences from the text as it can within that length. If no sentences, it will just trim to the maximum length allowed.
1
1036
posted 16 years ago by DaveChild
Function replaces all non-alpha-numeric chars and cleans up a text string. Should output a usable URL for almost all text.
1
1043
posted 16 years ago by DaveChild