SHARE
TWEET

Untitled




Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- <?php
- function factorialArray($arrayNombre)
- {
- $factorials = array();
- if (is_array($arrayNombre) && is_int($arrayNombre)) {
- foreach ($arrayNombre as $numero) {
- for ($i = $numero - 1; i > 1; $i--) {
- $numero = $numero * $i;
- }
- $factorials[] = $numero;
- }
- foreach ($factorials as $factorials){
- echo $factorials;
- }
- }else{
- return false;
- }
- }
- $nombres = array(15, 42, 12, 22, 77);
- factorialArray($nombres);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.