Looking for a string
Posted: Fri Aug 08, 2008 6:14 am
What would be quicker? Looping through a for loop of an array, looking to see if the value of an element matches a string, or looking for the sub string in a larger string?
What I want to do is see if an html tag is an inline tag or not. I want to look at the tag name and then check if it is inline by looking in an array of tag names (that are inline). Would this be quicker if I just made a string of the inline tags and checked this for a substr?
Also is it quicker to loop through an array with numbers as elements, or an assoc. array with strings as element names?
What I want to do is see if an html tag is an inline tag or not. I want to look at the tag name and then check if it is inline by looking in an array of tag names (that are inline). Would this be quicker if I just made a string of the inline tags and checked this for a substr?
Also is it quicker to loop through an array with numbers as elements, or an assoc. array with strings as element names?