Add chain_to_string function
This function turns the chain into a string that can be sent to the group
This commit is contained in:
parent
fedd816e73
commit
90f69802cb
|
@ -70,5 +70,18 @@ function get_longest_chain() {
|
||||||
}
|
}
|
||||||
return $chains[$longest_chain_index];
|
return $chains[$longest_chain_index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Converts chain to string for sending
|
||||||
|
function chain_to_string($chain) {
|
||||||
|
$string = "";
|
||||||
|
for ($i = count($chain) - 1; $i >= 0 ; $i--) {
|
||||||
|
$string .= $chain[$i]['username'];
|
||||||
|
if ($i != 0) {
|
||||||
|
$string .= " > ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $string;
|
||||||
|
}
|
||||||
|
|
||||||
$conn->close();
|
$conn->close();
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue