-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbotstat.php
More file actions
43 lines (39 loc) · 779 Bytes
/
Copy pathbotstat.php
File metadata and controls
43 lines (39 loc) · 779 Bytes
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
<?php
function botstat($params, $values)
{
if(is_array($params) && is_array($values)) // check if params and values are defined
{
$results = [];
foreach(array_combine($params, $values) as $packet => $value)
{
$results[] = $packet . '="' . $value . '"';
}
$finalStr = implode(' ', $results);
return '<bs ' . $finalStr . ' />'; // yeah, it works
}
else
{
return false; // nope, its wrong
}
}
/*
a is Avatar,
n is Nickname,
s is Status,
h is Homepage
*/
$packets = ['n', 'a'];
/*
All values should be added there
*/
$values = ['My name is Laming', '158'];
/*
Calling the function
*/
$callItBaby = botstat($packets, $values);
print($callItBaby);
/*
Result would be like:
<bs n="My name is Laming" a="158" />
*/
?>