The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
PHP Reading Data
Hello,
I currently help run a video gaming clan, and am a webmaster for the website. My experience and knowledge of PHP is very limited; however I have been taught how to code in Turing, Visual Basic, Java, and Python. Our clan has an application process which requires administrators numerous to complete numerous steps. Essentially, we are looking to shrink this process down to a click of a button. We currently use the Easy Forms mod for vB3, and I'm looking to collect information from the form that the script will then apply to their forum account (eg. their desired alias in the clan). However, Easy Forms does not store each field from the form in its own column of the MySQL table, and instead regurgitates the form fields into one single column on one single line. Ideally, I would have simply liked to have read the data straight from the "formresults" table and input the corresponding information into the "users" table, but that isn't possible here. A back up plan was to go through the form line by line and collect the information that way, but it's all stored on a single line and uses BB code for formatting, so that again isn't possible here either. The method I've been taught in the other languages I know to tackle a string like this is to go through character by character and find the information I want and store it in a new variable. However, I haven't been able to find an information on how I might go to a certain position within a string with PHP to accomplish that method. If anyone is able help with this, or suggest an alternative method, that'd be greatly appreciated. |
#2
|
|||
|
|||
Do you have an example of the string so we can see how it's formatted?
|
#3
|
|||
|
|||
I've actually managed to split it up and get the details I need using the explode() function. I didn't realize you could customize the parameter of where you want the function to split the string up. Here's an example anyway in case there is a more efficient method. It stores two forms of output, I used this one with the explode() function.
Quote:
|
#4
|
|||
|
|||
That's a serialized array, so ideally you should use unserialize to get the data back out again.
For example.... PHP Code:
PHP Code:
|
#5
|
|||
|
|||
Cheers! Thanks for the advice. I'll definitely keep this in mind if I come across another serialized array.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|