-
Notifications
You must be signed in to change notification settings - Fork 0
/
tool.php
53 lines (50 loc) · 1.39 KB
/
tool.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
<?php
function GetLangage($nom)
{
$file = explode('.', $nom);
$extension = $file[sizeof($file) - 1];
if ($extension == "c") {
return "C";
} else if ($extension == "cpp"){
return "C++";
} else if ($extension == "h") {
return "C";
} else if ($extension == "hpp"){
return "C++";
} else if ($extension == "php"){
return "PHP";
} else if ($extension == "css"){
return "CSS";
} else if ($extension == "html"){
return "HTML";
} else if ($extension == "json"){
return "JSON";
} else if ($extension == "js"){
return "JAVASCRIPT";
} else if ($extension == "java"){
return "JAVA";
} else if ($extension == "rb"){
return "RUBY";
} else if ($extension == "md"){
return "MARKDOWN";
} else if ($extension == "exe"){
return "BINARY WINDOWS";
} else if ($extension == "bat"){
return "BASH WINDOWS";
} else if ($extension == "sh"){
return "BASH UNIX";
} else if ($extension == "py"){
return "PYTHON";
} else {
return "unkown";
}
}
function HTMLCONVERT($code){
$code = str_replace('&', '&', $code);
$code = str_replace('<', '<', $code);
$code = str_replace('>', '>', $code);
$code = str_replace(' '/* TAB */, ' ', $code);
$code = nl2br($code, TRUE);
return $code;
}
?>