eduard Posted February 9, 2011 Share Posted February 9, 2011 Why do you use a Strien function? Link to comment Share on other sites More sharing options...
Synook Posted February 9, 2011 Share Posted February 9, 2011 There is no function called strien(). If you mean strlen(), well, you use it to find the length of a string. Link to comment Share on other sites More sharing options...
eduard Posted February 9, 2011 Author Share Posted February 9, 2011 I understand that strien is for the length of a string! But when and why are you using it? Link to comment Share on other sites More sharing options...
justsomeguy Posted February 9, 2011 Share Posted February 9, 2011 There are any number of situations where you want to find the length of a string. Maybe you're doing form validation, and you want to make sure it's not too long. Maybe you're looping through each character in the string, and need to know how many times to loop. Link to comment Share on other sites More sharing options...
eduard Posted February 9, 2011 Author Share Posted February 9, 2011 There are any number of situations where you want to find the length of a string. Maybe you're doing form validation, and you want to make sure it's not too long. Maybe you're looping through each character in the string, and need to know how many times to loop.Ok, thanks! Link to comment Share on other sites More sharing options...
ShadowMage Posted February 9, 2011 Share Posted February 9, 2011 I understand that strien is for the length of a string! But when and why are you using it?strlen, not strienIt has a variety of uses. It depends on your application. If, for some reason, you need to know the length of a string, you use strlen. I can't think of any specific examples right now, but I'm sure others will. EDIT: See, jsg, already beat me to the punch. Link to comment Share on other sites More sharing options...
Synook Posted February 10, 2011 Share Posted February 10, 2011 If you look through the examples and comments at the bottom of a PHP manual page, such as that for strlen(), you can usually find some relevant applications. Link to comment Share on other sites More sharing options...
eduard Posted February 10, 2011 Author Share Posted February 10, 2011 If you look through the examples and comments at the bottom of a PHP manual page, such as that for strlen(), you can usually find some relevant applications.Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.