PHP programming question?
Nathan asked the question:
Okay,
I am trying to create an application.. Where a user inputs data into a text box… Which I am using $_POST method to retreive this information… maybe, $_GET, if I change it, dunno yet..
The data that users put into the form is hand histories from online poker…I am sure, some of you know what im talking about… If not, goto pokerhand.org and you will know… I am creating something like this…
But, I am stuck and somewhat new to programming with PHP…
I am wanting the scripts to read multiple hand histories.. that users input.. where it will parse the whole game and not just one hand… But, I don’t know how to tell the scripts to identify each hand seperately..
Where the scripts/patterns i am putting together would just clump and scramble all of the information from the inputed hands histories from users and output something totally off..
I need a way to have the scripts identify each hand history serperately,, How would you go about this?
Related posts:
- Which books should I start with to learn computer Network programming, PHP, Perl and MySQL? Ozz*mosis* asked the question: I want to learn network programming,...
- Any good websites that teaches php programming? Dark_Fox asked the question: I’m taking a php class, but...
- Computer programming. Is Python Similar to PHP? ? hold_on_and_stay_strong asked the question: I found this open source book:...
- PHP programming for ContactUS Page? James Azad asked the question: Hi, Can someone please upload...
- Is Ajax a faster programming language than PHP? LUIS III asked the question: I read somewhere that Ajax...
Filed Under Programming & Design |
Tagged With Game, Scripts, Seperately
Comments
3 Responses to “PHP programming question?”
You need to write a parser, which requires syntactic analysis knowledge. Basically, you need to be a programmer.
This might work, I haven’t tried it to see, but you will want to do something like the following:
- read your $_REQUEST (that way you can switch between POST and GET and not have the change the parsing)
- split what is read on the line ending, should be \n, this should put each line into an array. split() may work, if not use preg_split()
- loop through the array parsing each element and doing different logic based on the content.
basically you will need the start of a hand to have something unique, which it usually does, like the table number or something like that (yes, I play lot of online poker as well). That will be your cue to start a new hand.
That is pretty generic, but should get you going in the right direction. Not sure what your experience level is with PHP, but basically you need to parse each line of the input and do different actions based on the content of the line.
use a separate text box for each hand on your form. Give each one a different name, and then you can refer to each hand separately by referring to the name of the text box.