Welcome Guest, Not a member yet? Register   Sign In
Handy string functions
#1

[eluser]bena[/eluser]
Hi peeps,

Thought I'd share some functions I find quite handy when I'm developing. There's also a little guide for anyone interested in using them.

is_str() - a more solid version of the is_string() function
str_append() - appends a string to a string if not already present
str_prepend() - prepends a string to a string if not already present
str_convert_special() - converts special characters to an appropriate equivalent (I think this was based on something I saw in wordpress)
str_numonly() - strips everything except numbers from a string (lazy I know)
str_safemail() - formats an email address for safer use in HTML pages
_now() - technically belongs in a date helper... it's just like CI's now() function but supports a few different output formats (date|time|datetime|unix)

Please let me know if there are already functions out there doing the same thing! Smile Hope someone finds them useful.

Regards,
Ben


Messages In This Thread
Handy string functions - by El Forum - 01-18-2010, 03:57 PM
Handy string functions - by El Forum - 01-18-2010, 09:30 PM
Handy string functions - by El Forum - 01-19-2010, 03:53 AM
Handy string functions - by El Forum - 01-19-2010, 10:50 AM
Handy string functions - by El Forum - 01-19-2010, 12:41 PM
Handy string functions - by El Forum - 01-20-2010, 05:56 PM
Handy string functions - by El Forum - 01-20-2010, 11:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB