Little changes for ./system/helpers/string_helper.php |
[eluser]manuw[/eluser]
Dear, I have added two small new features to ./system/helpers/string_helper.php. Code: /** and Code: /** I did not want to keep to myself The code should be self explanatory Greetz, manuw
[eluser]n0xie[/eluser]
Would be easier to just extend the helper instead of hacking a system file, but other than that, nice contribution.
[eluser]hugle[/eluser]
Nice contribution thanks btw, you can name it MY_string_helper.php put it in app/helpers and when you'll load it by load->helper('string'); you'll get all core string functions and your added too so if you update someday your core, you'll won't loose your functions! good luck
[eluser]sophistry[/eluser]
lovely! how about this to make it streamlined (saves a var assign): Code: function endsWith($haystack, $needle)
[eluser]manuw[/eluser]
Thanks Guys. Yes. A own helper are better way =) I have a own CodeIgniter "Remix" with many function in the core (e.g. lib, helper). I add it next time. Edit: @sophistry: your "bonsai" looks better then mine Code looks good, but i dont like this coding style Code: if(x===y) return true; I'm a friend of the { } . But okay, each his own. Greetz
[eluser]manuw[/eluser]
The next one. Code: /** Github greetz, manuw
[eluser]danmontgomery[/eluser]
http://www.php.net/manual/en/function.str-split.php
[eluser]sophistry[/eluser]
str_split() is PHP5. i found this funny little thing at the php.net comments page for str_split(). it's so cute! Code: function strsplit($str, $l=1) |
Welcome Guest, Not a member yet? Register Sign In |