forked from angular/angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
greet.php
57 lines (57 loc) · 1.03 KB
/
greet.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
error_reporting(0);
$name = $_GET['name'];
$callback = $_GET['callback'];
$salutations = array(
"Adab",
"Ahoj",
"An-nyeong-ha-se-yo",
"Apa khabar",
"Barev Dzez",
"Buenos días",
"Bula Vinaka",
"Chào",
"Ciao",
"Dia Duit",
"Hallo",
"Hallå",
"Halló",
"Halo",
"Haye",
"Hei",
"Hej",
"Hello",
"Helo",
"Hola",
"Kamusta",
"Konnichiwa",
"Merhaba",
"Mingalarba",
"Namaskar",
"Namaste",
"Olá",
"Pryvit",
"Pryvitannie",
"Përshëndetje",
"Salam",
"Salut",
"Sat Sri Akal",
"Sholem aleikhem",
"Sveiki",
"Szia",
"Tere",
"Zdraveĭte",
"Zdravo" );
$salutation = $salutations[rand(0, count($salutations) - 1)];
$greeting = $salutation . ' ' . $name . '!';
$data = array(
"name" => $name,
"salutation" => $salutation,
"greeting" => $greeting );
$json = json_encode($data);
header("Content-type: text/javascript");
if ($callback)
echo $callback .' (' . $json . ');';
else
echo $json;
?>