hermetis Posted June 22, 2013 Share Posted June 22, 2013 (edited) <?php print substr_count("5485345=34534","="); ?> it prints 1 instead of 7. How can i count what is before = ? Thanks very much in advance Edited June 22, 2013 by hermetis Quote Link to comment https://forums.phpfreaks.com/topic/279444-substr_count-question/ Share on other sites More sharing options...
kicken Posted June 22, 2013 Share Posted June 22, 2013 use strpos to find the location of the =. It's location would be equal to the count of things before it. Quote Link to comment https://forums.phpfreaks.com/topic/279444-substr_count-question/#findComment-1437352 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.