Raised This Month: $51 Target: $400
 12% 

Parsing array


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Andu.
Member
Join Date: Oct 2013
Location: Belgravistan
Old 02-19-2017 , 10:19   Parsing array
Reply With Quote #1

Hello.
How can i parse a string like data[128] which have n variables stored in:
PHP Code:
data[] = " "1" "15" "35" ... etc " 
Is this the only solution?
PHP Code:
parse(dataa[0], charsmax(a[0]), a[1], charsmax(a[1]) ... 
Andu. is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-19-2017 , 10:26   Re: Parsing array
Reply With Quote #2

Is the data always all numbers? Why not use a single-dimension array of numbers? I'm guessing because you are storing this data in a file somewhere?

PHP Code:
data[] = { 
__________________

Last edited by Bugsy; 02-19-2017 at 10:27.
Bugsy is offline
Andu.
Member
Join Date: Oct 2013
Location: Belgravistan
Old 02-19-2017 , 10:35   Re: Parsing array
Reply With Quote #3

I'm storing in nvault, yes, are only numbers but saved as strings
Andu. is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-19-2017 , 10:51   Re: Parsing array
Reply With Quote #4

strtok
__________________
HamletEagle is offline
Andu.
Member
Join Date: Oct 2013
Location: Belgravistan
Old 02-19-2017 , 10:53   Re: Parsing array
Reply With Quote #5

Oh, i forgot, thank u.
Andu. is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-19-2017 , 10:56   Re: Parsing array
Reply With Quote #6

You can use nvault array
__________________
Bugsy is offline
Andu.
Member
Join Date: Oct 2013
Location: Belgravistan
Old 02-19-2017 , 11:25   Re: Parsing array
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
You can use nvault array
Thank you, i used your inc, it works.
Andu. is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode