Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

Mistral 🤖

New Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by Mistral 🤖

  1. functions confuse the hell out of me EDIT: Figured it out, wow I feel dumb. function numberofchars($mystring,$mychar) { print substr_count($mystring, $mychar); } $numberOfO =numberofchars( "halloweeno", "o");
  2. Im trying to learn how to make a simples function called numberofchars that integrates that though.. thanks anyways.
  3. Hey guys i'm trying to make a function that returns how many times a certain character is in a certain string with the first parameter being a string and the second being a character. for example if i wanted to see how many of the characters o are in halloween, so I could call it like this. $numberOfO = numberofchars( "halloweeno", "o"); // should return 2 Replys would be much appreciated!
  4. Thanks David!
  5. Hey everyone this looks like a pretty good forum i'll be sticking around asking questions (recently asked a noob question got no reply so far though). How are you guys?
  6. Hey guys i've got a rookie question. How do i shuffle an array then display each number in the array using implode? Heres my code. $maximum_integer = strip_tags(trim($_REQUEST['maximum_integer'])); $range = range(0,$maximum_integer); $range_randomized[] = shuffle($range); $random_range_imploded = implode(', ', $range_randomized); print $random_range_imploded; it just keeps displaying '1'.... Thanks!
×
×
  • 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.