How do you allow puntuation to pass through unchanged

  • Dorky
  • Novice
  • Novice
  • Dorky
  • Posts: 15

Post 3+ Months Ago

this has some values that may include apostrophes and i need to allow them. however if i use stripslashes it cuts off
all charactures preceding the apostrophe. any suggestions.


Code: [ Select ]
<?php

$pspell_link = pspell_new("en");
if(isset($_GET['text'])) {
$words = ($_GET['text']) ; }
echo "<form method='get' action='spell.php'>";


if (isset($_GET['0'])) echo "0";
{
foreach($_GET as $key0 => $marker) 
{
$value = split('[ ]', $marker );
$value0[] = $value[0] ; $value1[] = $value[1] ; echo "Value : |0| $value0 |1| $value1 |Key| $key0 <hr>";
echo "Print Value Stage 1:"; print_r($value0); print_r($value1); echo "<hr>";
}
$print = str_replace( $value0 , $value1 , $words );

}


if(!isset($_GET['0']))
{
$print = $words;
}







if (isset($_GET['check']))
{ echo "<b><i> $words </i></b><hr>";
$string = split('[ ]', $words); foreach($string as $key1 => $word)
if (!pspell_check($pspell_link, $word))
{
echo "<hr><b><i>$word</i></b><br>"; $suggestions = pspell_suggest($pspell_link, $word);
foreach($suggestions as $key2 => $suggestion)
{
    $send = "$word $suggestion"; echo "<input type='checkbox' name='$key1' value='$send'>$suggestion<br>";
}
}
}


echo "<hr><textarea name='text'class='textarea' type='text/plain' rows='15' cols='40'>$print</textarea><hr>";
if(!isset($_GET['check'])) { echo "<button name='check' value='check check' type='submit'>Check Spelling</button>"; }
if(isset($_GET['check'])) { echo "<button name='done' value='done done' type='submit'>Done</button>"; }
echo "</form>";

unset($print);

?>
  1. <?php
  2. $pspell_link = pspell_new("en");
  3. if(isset($_GET['text'])) {
  4. $words = ($_GET['text']) ; }
  5. echo "<form method='get' action='spell.php'>";
  6. if (isset($_GET['0'])) echo "0";
  7. {
  8. foreach($_GET as $key0 => $marker) 
  9. {
  10. $value = split('[ ]', $marker );
  11. $value0[] = $value[0] ; $value1[] = $value[1] ; echo "Value : |0| $value0 |1| $value1 |Key| $key0 <hr>";
  12. echo "Print Value Stage 1:"; print_r($value0); print_r($value1); echo "<hr>";
  13. }
  14. $print = str_replace( $value0 , $value1 , $words );
  15. }
  16. if(!isset($_GET['0']))
  17. {
  18. $print = $words;
  19. }
  20. if (isset($_GET['check']))
  21. { echo "<b><i> $words </i></b><hr>";
  22. $string = split('[ ]', $words); foreach($string as $key1 => $word)
  23. if (!pspell_check($pspell_link, $word))
  24. {
  25. echo "<hr><b><i>$word</i></b><br>"; $suggestions = pspell_suggest($pspell_link, $word);
  26. foreach($suggestions as $key2 => $suggestion)
  27. {
  28.     $send = "$word $suggestion"; echo "<input type='checkbox' name='$key1' value='$send'>$suggestion<br>";
  29. }
  30. }
  31. }
  32. echo "<hr><textarea name='text'class='textarea' type='text/plain' rows='15' cols='40'>$print</textarea><hr>";
  33. if(!isset($_GET['check'])) { echo "<button name='check' value='check check' type='submit'>Check Spelling</button>"; }
  34. if(isset($_GET['check'])) { echo "<button name='done' value='done done' type='submit'>Done</button>"; }
  35. echo "</form>";
  36. unset($print);
  37. ?>
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 74 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.