yolop Posted September 1, 2008 Share Posted September 1, 2008 i need "for" that print all the word between "a" - to- "zzzzzzzz" like.. a b c ...... z aa ab ..... zz aaa aab .... zzz .... aaaa .... how i do that please??? thankkk Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/ Share on other sites More sharing options...
JasonLewis Posted September 1, 2008 Share Posted September 1, 2008 What? Why? What do you plan on cracking? Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631001 Share on other sites More sharing options...
valtido Posted September 1, 2008 Share Posted September 1, 2008 $as = 'a'; for ( $counter = 0; $counter< 100 ; $counter++) { echo $as.'<br />'; $as++; } do not hackkkkkkkk lol im not responsible for this crap hahah Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631005 Share on other sites More sharing options...
ranjuvs Posted September 1, 2008 Share Posted September 1, 2008 $alphabets = array(1=>'a',2=>'b',3=>'c',4=>'d'); //as you need to print 5 z's at last -> loop the fisrt loop for 5 for($outer = 1;$outer <= 5;$outer++) { foreach($alphabets as $alpha) { for($i=1;$i<=$outer;$i++) print $alpha; print "\n"; } } Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631006 Share on other sites More sharing options...
kenrbnsn Posted September 1, 2008 Share Posted September 1, 2008 Do you realize how long that will take and how many strings you will be generating? (Answer 8,353,082,582) Ken Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631008 Share on other sites More sharing options...
yolop Posted September 1, 2008 Author Share Posted September 1, 2008 it's not for hack this is what your script do a b c d aa bb cc dd aaa bbb ccc ddd aaaa bbbb cccc dddd i what after "aa" will show "ab" not bb thank Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631009 Share on other sites More sharing options...
JasonLewis Posted September 1, 2008 Share Posted September 1, 2008 valtido should do what you want. But kenrbnsn is right. It's ridiculous, the server load would be intense. It may even result in a timeout due to the time it could take. Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631010 Share on other sites More sharing options...
yolop Posted September 1, 2008 Author Share Posted September 1, 2008 Do you realize how long that will take and how many strings you will be generating? Ken i need that for only to realize how it's work in my system i will use that ..... i will get "word" like "abcc" and I need to print what's the next word in this case after "abcc" is"abcd" so i need something like that Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631011 Share on other sites More sharing options...
valtido Posted September 1, 2008 Share Posted September 1, 2008 lol i did try n post that but because someone posted it didnt really go through hey he asked for a stupid code lol i gave him one he cold seperate the code lol and start it from another bit instead a like $as = 'aaadcb'; for ( $counter = 0; $counter< 100 ; $counter++) { echo $as.' '; $as++; } so its first value would be 'aaadcb' and then 'aaadcc' and so on i did give him up 100 output lol he can chnage it till it crashes the browser or times out lol fairly simple Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631012 Share on other sites More sharing options...
valtido Posted September 1, 2008 Share Posted September 1, 2008 after all it was a stupid request and a stupid script lol but it really does give him what he wants Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631015 Share on other sites More sharing options...
Fadion Posted September 1, 2008 Share Posted September 1, 2008 Lol i just tried having a $counter<100000 on my 2GHz Core2Duo and it took forever until it printed the last value of: "eqxd". For more then that, one will need a mainframe Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631016 Share on other sites More sharing options...
valtido Posted September 1, 2008 Share Posted September 1, 2008 thats because it timed out or it crashed ur browser lol or something Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631018 Share on other sites More sharing options...
yolop Posted September 1, 2008 Author Share Posted September 1, 2008 thank man Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631019 Share on other sites More sharing options...
JasonLewis Posted September 1, 2008 Share Posted September 1, 2008 I can't remember what I put it too, but it kept loading and displaying as it went for about 20 seconds and I got sick of it. So I closed. Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631020 Share on other sites More sharing options...
matmunn14 Posted September 1, 2008 Share Posted September 1, 2008 Lol i just tried having a $counter<100000 on my 2GHz Core2Duo and it took forever until it printed the last value of: "eqxd". For more then that, one will need a mainframe Wonder how it would go on my 2.4ghz core 2 quad Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631021 Share on other sites More sharing options...
valtido Posted September 1, 2008 Share Posted September 1, 2008 $as = 'a'; for ( $counter = 0; $counter< 1000000 ; $counter++) { echo $counter.'-'.$as.'<br />'; $as++; } lol this is funny 177144 - jbag lol so u see it takes a long time lol but gives the guy the result lol Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631024 Share on other sites More sharing options...
kenrbnsn Posted September 1, 2008 Share Posted September 1, 2008 This sounds very much like a homework assignment, if so, we don't help you with your homework. Ken Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631025 Share on other sites More sharing options...
Fadion Posted September 1, 2008 Share Posted September 1, 2008 Wonder how it would go on my 2.4ghz core 2 quad I'm sure it won't go far Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631028 Share on other sites More sharing options...
valtido Posted September 1, 2008 Share Posted September 1, 2008 lol believe it or not this was some code that was used long time ago to crash computers when computers had little processors back in the days lol hackers felt genius of that at the time lol but they used it on visual basic or java or them programming languages more like a virus or something lol n set it up to run on start up lol Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631029 Share on other sites More sharing options...
yolop Posted September 1, 2008 Author Share Posted September 1, 2008 hi $as = 'az'; for ( $counter = 0; $counter< 3 ; $counter++) { echo $as.''; $as++; } it's good but i want to save like that and print $as = 'az'; for ( $counter = 0; $counter< 1 ; $counter++) { $as=$as.''; $as++; } echo $as why it's doesn't work????? Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631033 Share on other sites More sharing options...
valtido Posted September 1, 2008 Share Posted September 1, 2008 use MS excel lol type a and drag down till the end lol i think that would work to u might need to pres Ctrl aswell lol thatway u have them saved then copy and paste besides where do you want to save them ? Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631035 Share on other sites More sharing options...
Fadion Posted September 1, 2008 Share Posted September 1, 2008 <?php $as .= $as; //case 1 $as .= $as . '\n'; //case 2 $as .= $as . '<br />'; //case 3 ?> Choose whatever you like. Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631115 Share on other sites More sharing options...
matmunn14 Posted September 2, 2008 Share Posted September 2, 2008 hi $as = 'az'; for ( $counter = 0; $counter< 3 ; $counter++) { echo $as.''; $as++; } it's good but i want to save like that and print $as = 'az'; for ( $counter = 0; $counter< 1 ; $counter++) { $as=$as.''; $as++; } echo $as why it's doesn't work????? Because you are resetting the variable $as within the loop. Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631719 Share on other sites More sharing options...
saiko Posted September 2, 2008 Share Posted September 2, 2008 $as = 'a'; for ( $counter = 0; $counter< 1000000 ; $counter++) { echo $counter.'-'.$as.'<br />'; $as++; } lol this is funny 177144 - jbag lol so u see it takes a long time lol but gives the guy the result lol valtido you say "lol" to much. there is no need for it, its annoying. Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631732 Share on other sites More sharing options...
Fadion Posted September 2, 2008 Share Posted September 2, 2008 valtido you say "lol" to much. there is no need for it, its annoying. I noticed that too (everybody must have noticed it). You can count 4-5 lols in just one of his post and doing a forum search for "lol" will bring up only valtido's posts Link to comment https://forums.phpfreaks.com/topic/122217-i-need-help-with-for/#findComment-631737 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.