Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Easy syntax question
djo2112
What I'm trying to do is snag the sub-string before the question mark in a string. Here's what I am using:
$BRANCH_PATH = substr($BRANCH_PATH, 0, index ($BRANCH_PATH,'?',POSITION));
This works and the script executes but gives an error in iwutild_cmdout.log: Argument "POSITION" isn't numeric in index at NJ_Deploy.ipl line 94.
I was hoping for some critique from the experts. Thanks!
-Dave
Find more posts tagged with
Comments
nipper
Are you literally putting POSITION in the call ? That is the problem, index is looking for a #
The index function searches for one string within another, but without the wildcard-like behavior of a full regular-expression pattern match. It returns the position of the first occurrence of SUBSTR in STR at or after POSITION. If POSITION is omitted, starts searching from the beginning of the string. POSITION before the beginning of the string or after its end is treated as if it were the beginning or the end, respectively. POSITION and the return value are based at 0
djo2112
Thanks "A"!!!
I interperated "POSITION" as a literal value and not a variable.
It's OK, it's Friday and you will all forget about this by Monday!
Thanks!
-Dave