The premise of this script is to use the str_replace command to replace place holders that are within a rtf file (a resume for this example). $keystrengthX is a variable that contains what was entered in the database for this value. If nothing was entered then the variable is equal to "" (nothing).
After the script is run and i open up the RTF file ($output) the line i wanted to replace is still there (for this example that line is a row inside a table, inside a rtf file).
I dont know if $search parameter (what is being replaced) has to be less than 255 or if im doing something very wrong, any help is appreciated.
$keystrength9
if($keystrength9 == "")
{
$output = str_replace("\clbrdrl\brdrw10\brdrs\brdrcf1\clbrdrt\brdrw10\brdrs\brdrcf1\clbrdrb\brdrw10\brdrs\brdrcf1 \cellx4680\clbrdrl\brdrw10\brdrs\brdrcf1\clbrdrt\brdrw10\brdrs\brdrcf1\clbrdrr\brdrw10\brdrs\brdrcf1\clbrdrb\brdrw10\brdrs\brdrcf1 \cellx9468\pard\intbl\nowidctlpar\fi-360\li720\bullet [keystrength9]\cell\bullet [keystrengthTEN]\cell\row", "", $output) ;
}
else{
$output = str_replace("[keystrength9]", $keystrength9, $output) ;
if($keystrength10 == "")
{
$output = str_replace("\bullet [keystrengthTEN]", "", $output) ;
}
else{
$output = str_replace("[keystrengthTEN]", $keystrength10, $output) ;
}
}