First:
I need to split up a string on white space:
$var = "1 word here another word";
the "1 word here" needs to be split from "another word". I've tried several things with switch and split but nothing works. Also, once they are split up, how do I remove the white space either before or after the values. For example:
"1 word here " down to "1 word here" and
" another word" down to "another word"
Second:
I need to evaluate the first two positions of a string to see if they're numeric. I cannot remember how to specify to only look at certain positions in a string and nothing else. How is that done?
Thanks in advance for your help.
You guys rock!
In reply to Split and Pattern Match by wfbojar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |