Jump to content

firedealer

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male
  • Location
    Phoenix, AZ

firedealer's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Aha! Thanks, it's working now.
  2. Thanks. I have update my code and still not working. ERROR MSG: Notice: Undefined variable: preg_match in /Applications/MAMP/htdocs/include/ip.php on line 6 Fatal error: Function name must be a string in /Applications/MAMP/htdocs/include/ip.php on line 6
  3. I know the regex_pattern is wrong. Help me out? <?php $content = "<html><head><title>Your IP</title></head><body>Your IP Address: 63.1.142.154</body></html>"; $regex_pattern = "/<body>([^>]*)<\/body>/si"; $preg_match($regex_pattern,htmlspecialchars($content),$matches); print_r( $matches ); ?>
  4. Oops! I'm suppose to post in regex section.
  5. I know $regex_pattern is wrong but I need a solution to find a content between <body> and </body>. <?php $content = "<html><head><title>Your IP</title></head><body>Your IP Address: 63.1.142.154</body></html>"; $regex_pattern = "/<body>(.*)<\/body>/"; $preg_match($regex_pattern,htmlspecialchars($content),$matches); print_r( $matches ); ?>
  6. You didn't post a php code. So, I assume you are looking for this: <?php $xmlFeed = 'workbook.xml'; $xmlFeed = simplexml_load_file($xmlFeed); ?> <html> <head></head> <body> <pre><? print_r ( $xmlFeed ); ?></pre> </body> </html>
  7. I'm not expert with XML, but XPATH address to a specific cell is possible? I'm just give an idea, so you can investigate this deeper.
  8. Eh, I just added: $_SESSION['win'] = empty($_SESSION['win']) ? NULL : $_SESSION['win']; $_SESSION['lose'] = empty($_SESSION['lose']) ? NULL : $_SESSION['lose']; $_SESSION['tie'] = empty($_SESSION['tie']) ? NULL : $_SESSION['tie']; Now, it's working without any glitch or burp. Thanks!
  9. Ah $_SESSION is the key. The score is working. However, the error come up which is Notice: "Undefined index: win in /Applications/MAMP/htdocs/sandbox/games/duelingcards/main_rockpaperscissors_session.php on line 57"
  10. I'm try to make a score increment every time win, lose, or tie the game.
  11. I'm new to function and I can't figure how to update/result the score. I developed a game called Rock, Paper, & Scissors, so I can learn the function itself with a simple game for now. http://pastebin.com/9MB7ATnt Any tips or instruction would be much appreciated. Thanks.
  12. Thanks! I need to study $_SESSION more, I suspect $_SESSION is most important part for almost any project. The in_array() function is new to me, there are so many functions! Again, thanks.
  13. I developed this game and I couldn't figure how to make random only on available shot glasses but it would still random with unavailable shot glasses. I simple give up. I plan to share this php once I nailed it down but apparently, not successful. Now, I'm share with you anyway. If you can solve the problem and please let us know! http://pastebin.com/F3N05ExK [attachment deleted by admin]
  14. Try to add this one? $_GET['sample'] = empty($_GET['sample']) ? NULL : $_GET['sample'];
  15. Thanks for a solution code. Here mine is: <?php $word = "applesauce"; $number = 5; $calc = ceil(strlen($word)/$number); $howmany = $calc; $chunks = $calc; echo "The $number-letter chunks of '$word' are:<br />\n"; for ($i=0; $i < $howmany; $i++) { $chunks = substr($word, $i*$number, $number); printf("%d: %s<br />\n", $i+1, $chunks); }
×
×
  • 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.