HehA function should, however, handle out-of-bounds inputs as gracefully as possible. It's a basic principle of programming.
I still think cutting the string more than the user explicitly requested is ugly and unintuitive to the user.
HehA function should, however, handle out-of-bounds inputs as gracefully as possible. It's a basic principle of programming.
I still think cutting the string more than the user explicitly requested is ugly and unintuitive to the user.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
It's about fitting it somewhere, not cutting the string. Name it fit2len($str,$len,$tail), and maybe that makes more sense. We may be seeing it as solving different problems.
Out-of-bounds inputs are usually dealt with by errors. Add an error if you'd like.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
It does make more sense like that, but as you say, that's a different problem.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
I didn't say I was solving a different problem, but that we were. Alex wants to display a preview in a limited region, meaning that he would want it to not overfill the space (probably thereby stretching his layout).Originally Posted by me
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Bookmarks