Created
February 15, 2016 11:35
-
-
Save jacek-9999/64c319344ab8d9e50ea2 to your computer and use it in GitHub Desktop.
index.php example for https://github.com/jacek-9999/credit-card-generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* with this index you can set bins in url like that: | |
* http://localhost/14124 | |
*/ | |
require __DIR__ . '/vendor/autoload.php'; | |
$rq = $_SERVER['REQUEST_URI']; | |
$arr = explode('/', $rq); | |
$arr = array_reverse($arr); | |
$num = (int)$arr[0]; | |
$creditCardGenerator = new jacek9999\creditCardGenerator(); | |
$creditCardGenerator->setBin($num); | |
$cc = $creditCardGenerator->getCC(); | |
header('Content-Type: application/json; charset=utf-8'); | |
echo json_encode($cc); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment