bobtutos Posted July 14, 2013 Share Posted July 14, 2013 Hi everybody! I would like to ask for your help if it possible, I have a long sting and I want to chop it to small pieces. My string is:- $longstr = “Str1.htmlstr2.htmlstr3.html”; And I want the result to be like; $firstchoppedpiece = “Str1.html”; $secondchoppedpiece =”Str2.html”; $thirdchoppedpiece =”Str2.html”; Is it possible? Or is there any PHP function or method to break it into small pieace? Your replies are greatly appreciated. Thank very much. Link to comment Share on other sites More sharing options...
Ingolme Posted July 14, 2013 Share Posted July 14, 2013 str_split() would cut a string into equally sized pieces: http://es1.php.net/manual/en/function.str-split.php explode() divides a string into pieces given a separator: http://es1.php.net/manual/en/function.explode.php 1 Link to comment Share on other sites More sharing options...
bobtutos Posted July 14, 2013 Author Share Posted July 14, 2013 Thank you for ur reply, I will check and test it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now