Querstion :- find login to print 1.input => ab output => a, ab, b 2. bana output => b, ba, ban, bana, a, an, ana, n,na, a Ans :- $str = "12345"; $ar = []; for($ui=0; $ui < strlen($str); $ui++) { $newstr = ($ui != 0)?substr($str, $ui):$str; for($i=1; $i <= strlen($newstr); $i++) { $ar[] = substr($newstr, 0, $i); } } echo "<pre>"; print_r($ar); Output :- Array ( [0] => 1 [1] => 12 [2] => 123 [3] => 1234 [4] => 12345 [5] => 2 [6] => 23 [7] => 234 [8] => 2345 [9] => 3 [10] => 34 [11] => 345 [12] => 4 [13] => 45 [14] => 5 )
We are a group of IT- Expert based in jaipur Rajasthan- 302019, we are working on different Top most MNC In india. We worked on thousands of website. if you don't have website we can create your best internet platform for you and your website in minimum of 5000 INR. you can hire you website developer for your projects. Contact Us for Free Quote on info@webuncles.com or call us on +91-9413547744