tamir Posted January 23, 2005 Share Posted January 23, 2005 if i want to create array i need to write Dim $arr[number], but what do i do if i want to split text to parts and to convert all the parts to array. i don't know how many parts there will be so what do i do? Link to comment Share on other sites More sharing options...
ezzetabi Posted January 23, 2005 Share Posted January 23, 2005 StringSplits() creates the array for you. Just create the array as variant. e.g. Local $t = 'abc|adf|ert' Local $array $array = StringSplit($t,'|') The $array[0] will contain the size, while $array[1] to $array[$array[0]] the elements. Link to comment Share on other sites More sharing options...
tamir Posted January 23, 2005 Author Share Posted January 23, 2005 i have a file: [] title1 a b c d [] title2 a b c d and i need to split the text to groups with "[]". the problem is that when i split it some array pieces are empty (dunno why) so i use "For" loop to check if the value is empty and if it isn't i add it to new array. u understand my problem? Link to comment Share on other sites More sharing options...
tamir Posted January 23, 2005 Author Share Posted January 23, 2005 u didnt understand my question.... i did the same like u but in the "for" loop i want to check if the array doesn't have empty value. if he doesn't then i want to add him to a new array ($arr). how do i do that? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now