Jump to content

oobradersoo

Members
  • Posts

    18
  • Joined

  • Last visited

oobradersoo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. { // do shit with numbers bradley_output($number1); bradley_output($number2); bradley_output($number3); bradley_output($number4); } function bradley_output($dogsbollocks) { for ($x=1; $x<=$dogsbollocks; $x++) { echo "$dogsbollocks <br>"; } // }
  2. could someone help me out am i right in saying i will need to use a for loop to output the answe code below: (creating a function) input 1 : 6 input 2 : 5 input 3 : 4 input 4 : 3 answer 666666 55555 4444 333 i do not know a lot i have been researching on internet for days an cant seem to cant anywhere. could someone help please
  3. i have learned how to echo out information via arrays etc. ATM i am trying to learn to build functions .
  4. i am wanting to learn how to build your own functions. i dont want to use str_repeat at all. sorry im a nub! how would you go about doing the loop?
  5. i dont want to use "str_repeat". could someone give me some ideas how to make my own function without using str_repeat i am wanting the user to enter 4 numbers into 4 input boxes for example input 1 : 6 input 2 : 5 input 3 : 4 input 4 : 3 answer 666666 55555 4444 333
  6. hello there people does any one know how to store a group of variables inside 1 variable. so if i had ($1, $2, $3, $4 ........) i am wanting to store them in 1 variable like so $list
  7. if you have 4 variables is there anyway to link them into one variable? { $number1 $number2 $number3 $number4 } $wholenumber
  8. there is a reason the form is like i have set it out. is there a way i can keep the form the same and do what i have asked?
  9. i want the user to have on his screen 1 22 333 4444
  10. "" Do you mean 4 input fields where you can enter in 4 numbers, and then repeat those 4 numbers how ever many times the number is? "" yes that's exactly what it is theirs my code which i am wanting to change <form action="form.php" method="POST"> <input type="hidden" name="id" value="1234" /> number 1:<input type="number" name="number1" value="<?php echo $number1;?>"/> <br> number 2:<input type="number" name="number2" value="<?php echo $number2;?>"/> <br> number 3:<input type="number" name="number3" value="<?php echo $number3;?>"/> <br> number 4:<input type="number" name="number4" value="<?php echo $number4;?>"/> <input type="submit" value="submit"/> </form> <?php if(null==($number1 && $number2 && $number3 && $number4)){ echo "Please fill in form above?"; } elseif(!(is_numeric($_POST['number1']) && is_numeric($_POST['number2']) && is_numeric($_POST['number3']) && is_numeric($_POST['number4']))){ echo "please put numbers in form"; } elseif(isset($_POST['number1']) && isset($_POST['number2']) && isset($_POST['number3']) && isset($_POST['number4'])){ echo "Answer: " . ($number1+$number2+$number3+$number4); } ?>
  11. i get what your saying but if a user had 4 boxes to type in how can you tell it to echo out amount of times she has entered?
  12. i have made a form which adding up each value which is entered. but i want to know if there is a way instead of adding up which is entered it will output it like i stated above. just asking for pointers really?
  13. could some one help with: creating a function to help you output each number, the number of times the number is … each on a separate line. So if I entered numbers 2, 3, 4 and 5 in my form then the output would be: 2 2 3 3 3 4 4 4 4 5 5 5 5 5
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.