Skip to content

Tag: random

PHP: How to play random mp4 videos in static url .php

I have a code in PHP language hosted in (free hosting), that shows on click a video randomly. But it works ONLY in VLC Player for Windows. The result is that the Chrome browser or Android donĀ“t show the video: And I have these questions: Is there a way to get the code to work on Android devices and

Shuffle() returns same results

I’m having a problem with using a basic shuffle() function in Laravel. It returns the same result, which seems to be changing once every 10 or 20 minutes. Here’s the basic code I’m testing: And here’s the log: Answer You probably initialize your random seed with a constant value somewhere else.

Generate save activation key as product key

I am trying to create a function which creates a random String. This String should consist of letters (only caps) and numbers. It will be used to activate a product. So the user has to type it into a text field. So far I found the following function: I do not have that much experience with random functions. So is

PHP – How to add more than 2 parameters to a variable?

So I have the following code: But it outputs this error: “Warning: rand() expects exactly 2 parameters, 10 given…” So I wonder how could I random the values of this variable and then print() only on in the p tag? Answer Since your numbers are in sequence, you could simply do Function Prototype: int rand ( int $min , int