zohab Posted January 28, 2010 Share Posted January 28, 2010 <?php echo"<br>".$rest = substr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",0,80); ?> Quote Link to comment https://forums.phpfreaks.com/topic/190088-find-substring-of-continues-string/ Share on other sites More sharing options...
Adam Posted January 28, 2010 Share Posted January 28, 2010 Well you've not really said what you're trying to do... Do you mean...? echo "<br>".substr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",0,80); Quote Link to comment https://forums.phpfreaks.com/topic/190088-find-substring-of-continues-string/#findComment-1002933 Share on other sites More sharing options...
salathe Posted January 28, 2010 Share Posted January 28, 2010 zohab, please ask a question or at least suggest a topic of discussion. Otherwise, we've no idea what you want to know. Quote Link to comment https://forums.phpfreaks.com/topic/190088-find-substring-of-continues-string/#findComment-1002936 Share on other sites More sharing options...
zohab Posted January 28, 2010 Author Share Posted January 28, 2010 my subject describe the problem as i want to find substring of continues string as per given example. In my project i want to show substring of description field. if user enter string "this is description text" then with substr() function i am able to get substring of the string but if user enter continues string then problem comes "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" in this case i am not able to get substring <?php $rest = substr("abcdef", 1); // returns "bcdef" $rest = substr("abcdef", 1, 3); // returns "bcd" $rest = substr("abcdef", 0, 4); // returns "abcd" echo "<br>".substr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",0,80); ?> Quote Link to comment https://forums.phpfreaks.com/topic/190088-find-substring-of-continues-string/#findComment-1002985 Share on other sites More sharing options...
Adam Posted January 28, 2010 Share Posted January 28, 2010 Actually the post subject didn't make sense, I assume you mean continuous? The code you posted works for me. Could you be more specific with what happens when you try to run the code? Quote Link to comment https://forums.phpfreaks.com/topic/190088-find-substring-of-continues-string/#findComment-1002987 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.