I need to delete the line that has the string 17555245531:secret@sip.mysip.com. How do I do this? When I run the attached code the first line [general] gets deleted.. Thank you for the help.
Take the double quotes off of $pLine in your array_search statement.
Marco Gasi
It deletes the first line (0 indexed) because array_search returns 0, that is false: it doesn't find the element you're looking for because (I think) you miss a semicolon in your code:
$pLine='17555245531:secret@sip.mysip.com'
instead of
$pLine='17555245531:secret@sip.mysip.com';
Try this while I test your code.
Cheers
aej1973
ASKER
Hello Barry62, there was no change once I removed the double quotes, the line that gets deleted is [general].