Jump to content

[SOLVED] combinations


dezkit

Recommended Posts

$alpha = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z";

$alphaArray = split(" ", $alha);

foreach ($alphaArray as $alpha) {
        foreach ($alphaArray as $alpha2) {
              echo $alpha . $alpha2 ", ";
        }
}

 

 

Link to comment
https://forums.phpfreaks.com/topic/135845-solved-combinations/#findComment-708112
Share on other sites

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/cobi/public_html/testtt.php on line 8

 

<?php
$alpha = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z";

$alphaArray = split(" ", $alha);

foreach ($alphaArray as $alpha) {
        foreach ($alphaArray as $alpha2) {
              echo $alpha . $alpha2 ", "; // line 8
        }
}
?>

line 8

Link to comment
https://forums.phpfreaks.com/topic/135845-solved-combinations/#findComment-708115
Share on other sites

Nevermind, i fixed it, but it shows nothing but a comma on my page

 

<?php
$alpha = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z";

$alphaArray = split(" ", $alha);

foreach ($alphaArray as $alpha) {
        foreach ($alphaArray as $alpha2) {
              echo $alpha . $alpha2 . ", ";
        }
}
?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/135845-solved-combinations/#findComment-708118
Share on other sites

Nevermind, i fixed it, but it shows nothing but a comma on my page

 

<?php
$alpha = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z";

$alphaArray = split(" ", $alha);

foreach ($alphaArray as $alpha) {
        foreach ($alphaArray as $alpha2) {
              echo $alpha . $alpha2 . ", ";
        }
}
?>

 

 

 

<?php
$alpha = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z";

$alphaArray = split(" ", $alpha); //spelling type here

foreach ($alphaArray as $alpha) {
        foreach ($alphaArray as $alpha2) {
              echo $alpha . $alpha2 . ", ";
        }
}
?>

 

Spelling typo on my part. That should work.

Link to comment
https://forums.phpfreaks.com/topic/135845-solved-combinations/#findComment-708121
Share on other sites

I got one more question, i have this right now

 

<?php
$alpha = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z";

$alphaArray = split(" ", $alpha);

foreach ($alphaArray as $alpha) {
        foreach ($alphaArray as $alpha2) {
              echo $alpha . $alpha2 . "<br>";
        }
}

?>

 

Is it possible so that every combination gets checked if its valid in "http://profile.mygamercard.net/*". If the gamertag exists, echo true, and if not echo false.

 

elaborated:

- php fread http://profile.mygamercard.net/x (x as in the combination of letters)

- if the content displays "does not exist on Xbox Live!", echo false

- Else echo true

 

 

Thanks sooooooooooooooo much in advance!!! :)

Link to comment
https://forums.phpfreaks.com/topic/135845-solved-combinations/#findComment-708129
Share on other sites

Is it possible so that every combination gets checked if its valid in "http://profile.mygamercard.net/*". If the gamertag exists, echo true, and if not echo false.

 

elaborated:

- php fread http://profile.mygamercard.net/x (x as in the combination of letters)

- if the content displays "does not exist on Xbox Live!", echo false

- Else echo true

 

Yes, that's possible. You'd just need to parse the web page to find out if the gamertag exists or not. Of course, the website might not be too happy with you bombarding them with requests.

 

$alpha = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z";
$alphaArray = split(" ", $alha);

 

The range function exists for a reason :P

Link to comment
https://forums.phpfreaks.com/topic/135845-solved-combinations/#findComment-708140
Share on other sites

Is it possible so that every combination gets checked if its valid in "http://profile.mygamercard.net/*". If the gamertag exists, echo true, and if not echo false.

 

elaborated:

- php fread http://profile.mygamercard.net/x (x as in the combination of letters)

- if the content displays "does not exist on Xbox Live!", echo false

- Else echo true

 

Yes, that's possible. You'd just need to parse the web page to find out if the gamertag exists or not. Of course, the website might not be too happy with you bombarding them with requests.

 

$alpha = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z";
$alphaArray = split(" ", $alha);

 

The range function exists for a reason :P

 

You learn something new every day =)

Link to comment
https://forums.phpfreaks.com/topic/135845-solved-combinations/#findComment-708143
Share on other sites

Sorry for so much bumping (really i am.) but i have this code:

<?php
$alpha = "a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 0";

$alphaArray = split(" ", $alpha); //spelling type here

foreach ($alphaArray as $alpha) {
        foreach ($alphaArray as $alpha2) {
           
           $main = $alpha.$alpha2;
           $filename = "http://profile.mygamercard.net/$main";
           $handle = fopen($filename, "r");
           if(strpos($handle, "does not exist on Xbox Live!") > 0){
            echo "true"; 
           } else {
            echo "false";
           }

        }
}

?>

 

I keep getting error "Warning: fopen(http://profile.mygamercard.net/aa) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /home/cobi/public_html/testtt.php on line 11

false"

Link to comment
https://forums.phpfreaks.com/topic/135845-solved-combinations/#findComment-708162
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.