RE: php maximum characters in text field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I was able to copy and paste from the customer's email exactly what they
were trying to submit.  When I back-spaced out their single quote and
put in my own, it worked fine.  That's how I narrowed it down to that
particular character.  With much help from a coworker, I was able to
implement some functions, and call them BEFORE php tries to create the
new record in the database.  That was my biggest problem ... I put the
cleanup code in the wrong place, after the new record command.  However,
here's what the function looks like (it also gets out ~'s:

function convert_smart_quotes($string) 
{
     $search = array(chr(145),
	               chr(146),
			   chr(147),
			   chr(148),
		     	   chr(151));
      $replace = array("'",
                       "'",
	   		     '"',
			     '"',
			     '-');
      return str_replace($search, $replace, $string); }


-----Original Message-----
From: Instruct ICC [mailto:instructicc@xxxxxxxxxxx] 
Sent: Wednesday, October 17, 2007 1:54 PM
To: php-db@xxxxxxxxxxxxx
Subject: RE:  php maximum characters in text field


> Does anyone know how to look for a "Curly quote" or "typographer's
quotation mark". They are being submitted on our form under customer
description. I have created a function that replaces a regular straight
quotation mark ($title = str_replace("'", "", $title);), but do not know
what to put in as the "look for" for the curly mark!

How do you know they are submitting ?
Can you copy  from that source, then paste it into your str_replace
function?

Or since it seems to be a two-byte character (I didn't see it at
asciitable.com):
Maybe you need http://php.he.net/manual/en/ref.mbstring.php
mb_ereg_replace

_________________________________________________________________
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us
-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux