Trying to figure out what I am dong wrong here but I am trying to search row 6 and replace the phrase "Plenty of stock available!" (with the quotation marks as it is in a CSV) with the number "10".
It works no issues when then with the 'lowstock' text, but not the "Plenty of stock available!". I have added the \ before it as to have it ignore the quotation mark (and view it as text).
//changes stock status
$row = fgetcsv($file);
if (strtolower($row[6]) == '\"Plenty of stock available!\"' || strtolower($row[6]) == 'lowstock') {
$row[6] = '10';
} else if (strtolower($row[6]) == 'nostock') {
$row[6] = '2';
strtolower($row[6])will never match aP, did you meanpinstead?strtolower($row[6]) == '\"Plenty of stock available!\"'need to bestrtolower($row[6]) == strtolower('"Plenty of stock available!"')