Merhaba!
Irgendwas ist aber falsch!
function x = Math.floor(Math.random() * bg.length);
echo($bg[x]);Möglicherweise liegt es daran, dass Du JavaScript-Objekte/
-Methoden in PHP verwendest.
Wie wäre es mit floor() und rand()?Gruß - Ollie
Danke für die schnelle Antwort! Danke!!!
Aber so geht es auch nicht, es kommt immer nur A, und kein mal B
<html><head></head><body><h1>Test</h1><?php
$bg[] = "A";
$bg[] = "B";
$x = floor(rand() * bg.length);
echo($bg[$x]);
?>
</body></html>