I have an array of 50 elements, and I would like to select 5 of them randomly and return an array. Is there a function for this?
Put the elements in an array and use:
$selectrand = array_rand($arrayname, 5);
Try the following:
$randomnumber = (rand()%$num);
Source: https://habr.com/ru/post/1711623/More articles:Web service using old proxy settings? - vb.netWhat is the difference between this.click () and $ (this) .click ()? - javascriptЧто является предпочтительным кросс-платформенным "основным" определением с использованием boost:: program_options? - c++Failed to get content from HttpServletRequest - javaQWinWidget Inside the dialog, MFC does not repaint or does not respond to Tab / Arrow keys - c ++WPF and VSM - list of states? - wpfCocoa: quartz, main graphics, context and view. Oh, my! - cocoa-touchHow to pass parameter TO SSRS report FROM ASP.NET, on which there is a report for the report - sql-serverIn Eclipse 3.5 (and with Aptana plugins), how do I get a view that I can use to display my project, including dot files? - eclipseWhy do Dev tools offer Quirks mode? - htmlAll Articles