You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
373 B

<?php
$slug = $_POST['slug'];
$emails_json = json_decode(file_get_contents(__DIR__.'/emails.json'), true);
$emails = [];
foreach ($emails_json as $email) {
$emails[$email['slug']] = $email;
}
if (!array_key_exists($slug, $emails)) {
header('HTTP/1.0 404 Not Found');
}
$email = $emails[$slug];
header('Content-Type: application/json');
die(json_encode($email));