erika/php/test.php

23 lines
643 B
PHP
Raw Permalink Normal View History

2021-01-23 17:14:13 +01:00
<?php
include 'const.php';
2021-01-23 17:43:41 +01:00
//$text = "#inlude<text.h>\nHallo\nLiebe #*sz_leute\näöü#+===)( snind Zeichen\nHier leer\n\n\n\r\n\t%Tock..----\n\nd";
$text = "bla blub\nsdsxy";
2021-01-23 17:14:13 +01:00
print $text;
2021-01-23 17:43:41 +01:00
$nlkorrekt = preg_replace('~\R~um', "\n", $text); // 2044 = /
2021-01-23 17:14:13 +01:00
//$suchmuster = '~[^-a-zA-Z0-9äüöÄÜÖß\s,;\.:()°%&²³µ€ç£èé=^_&$§"!+*#\?\t\n\r´`/]~m';
2021-01-23 17:43:41 +01:00
echo "=======\n";
echo $nlkorrekt;
echo "=======\n";
2021-01-23 17:14:13 +01:00
$suchmuster = REGEX_FILTER;
$ersetzung = '?';
2021-01-23 17:43:41 +01:00
$neuertext = preg_replace($suchmuster, $ersetzung, $nlkorrekt);
2021-01-23 17:14:13 +01:00
echo "Neuertext: \n-----\n$neuertext\n-------\n";
echo "\x0023";
2021-01-23 17:43:41 +01:00
print "".$suchmuster."\n";
2021-01-23 17:14:13 +01:00
?>