The ListDeleteAt function is a neat little coldfusion function and works just as well in PHP. This function is good for removing counted values from lists. I use it a lot in conjunction with other list functions. |
The Function: |
<php { |
Usage: |
To use the ListDeleteAt function with the default delimiter ',': <php$list = "a,b,c,d,e,f,g"; $position = 3; echo ListDeleteAt($list,$position); ?> |
The Result: a,b,d,e,f,g. The 'c' which was in the third position has noe been removed! |
To use the ListDeleteAt function with a custom delimiter: <php$list = "12345"; $position = 2; echo ListDeleteAt($list,$position); ?> |
The Result: '1345'. The '2' which was in the second position has noe been removed! |
Monday, December 24, 2007
ListDeleteAt
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment