Hello all. I can't seem to get these newline characters to go away for the life of me.
Could someone please lend a helping hand?
Here are a couple of the strings I am working with:
Esponja - celulosa resistente \n
Friega tempico con manija de 8\"\n
Friega tempico con manija de 20\"\n
mezclador rápido de 24\" - marca Diamond Wall\n
mezclador rápido de 36\" - marca Diamond Wall\n
Here is my code, minus everything I have tried before:
foreach($lines as $key => $value){
if(empty($value[0])) continue; /** break if model number is empty **/
$lines[$key] = rtrim($value);
$lines[$key] = explode("\t", $value);
$lines[$key][2] = preg_replace("#\x12$#", "", $lines[$key][2]);
$SQL = "select products_id from products where products_model='".$lines[$key][0]."'";
$QUERY = mysql_query($SQL);
$RESULT = mysql_result($QUERY, 0);
$lines[$key][3] = $RESULT;
$lines[$key][2] = mysql_real_escape_string($lines[$key][2]);
echo $lines[$key][2].'<br />';
$SQL = "UPDATE products_description SET products_name='".$lines[$key][2]."' WHERE products_id='".$lines[$key][3]."' LIMIT 1";
//echo $SQL.'<br />';
}
$lines[$key][2] is the string displayed above. Which is the call to "echo $lines[$key][2].'<br />';"
TIA hombres!