note 73489 added to function.str-replace

From: Date: Mon, 26 Feb 2007 01:48:56 +0000
Subject: note 73489 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-123862@lists.php.net to get a copy of this message
My input is MS Excel file but I want to save ‘,’,“,” as ',',",". $badchr = array( "\xc2", // prefix 1 "\x80", // prefix 2 "\x98", // single quote opening "\x99", // single quote closing "\x8c", // double quote opening "\x9d" // double quote closing ); $goodchr = array('', '', '\'', '\'', '"', '"'); str_replace($badchr, $goodchr, $strFromExcelFile); Works for me. ---- Server IP: 69.147.83.197 Probable Submitter: 202.175.217.2 ---- Manual Page -- http://www.php.net/manual/en/function.str-replace.php Edit -- https://master.php.net/note/edit/73489 Del: integrated -- https://master.php.net/note/delete/73489/integrated Del: useless -- https://master.php.net/note/delete/73489/useless Del: bad code -- https://master.php.net/note/delete/73489/bad+code Del: spam -- https://master.php.net/note/delete/73489/spam Del: non-english -- https://master.php.net/note/delete/73489/non-english Del: in docs -- https://master.php.net/note/delete/73489/in+docs Del: other reasons-- https://master.php.net/note/delete/73489 Reject -- https://master.php.net/note/reject/73489 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#123862) next »