Hello,
I am trying to get some basic php going on two pages. The first page is capturing a few of names and placing it in a string named: agentname. All the names are separated with a control character of "/".
When I print the variable's content in the next page, I see the names that I want to put in my DB. In the next bit of code, I am attempting to go through the string and find all of the "/", take the name and place it in an array. All the while, I keep a counter running so I know the number of names.
Here is the code that I started with but have been having trouble
myNames -> all of the names to parse
tempName -> to move the name
totAgent -> total agent count
$allNames[] -> array of names (strings)
for (i=0;i<$myNames.len;i++) {
if ($myNames = "/") {
if ($tempName <> '') {
$allNames[$totAgent]=$tempName;
alert($tempName);
$tempName='';
$totAgent++;
}
} else {
$tempName=$tempName+$myNames;
}
}
Page is not posting - instead I get a parse error
PHP Notice: Use of undefined constant len - assumed 'len'
need help - thank you