Jump to content

No preg text problem


web_master

Recommended Posts

Hi, I got a problem, and I don't  know where is a problem.

 

<?php

$TextUpload = $_POST['area1'];

$TextUpload = str_replace("  "," ", $TextUpload);

$TEXTAREAPreg = $TextUpload;

 

$Replacement['0'] = '/\\\"(.*?)\\\"/';

$Replacement['1'] = '/\\\'/';

$Replacement['2'] = '–';

 

$Replaced['0'] = '„$1”';

$Replaced['1'] = '’';

$Replaced['2'] = '—';

 

$NoPregText = preg_replace($Replacement, $Replaced, $TEXTAREAPreg);

?>

 

 

When I put the text in database without quotes (eg: text) than is OK, but when I put text between quotes (eg: "text"), than it's don't go into database...

 

So, can You help me what I'm do wrong?

 

Thnxs

Link to comment
Share on other sites

The code you posted... It has nothing to do with putting stuff into the database. Isn't that where the problem really is? Getting it into the database?

 

 

You right requinix the code don't work :( I found it somewhere on internet... but it seems not work... Do You have som script to change quotes - "" to „” (ALT + 0132, ALT+0148) and ' to ’ and two spaces to one space and the ALT + 0150 to ALT 0151?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.