Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Usuwanie znaków specjalnych i wybranych liter
d0m1n1k_
post 31.10.2015, 12:59:20
Post #1





Grupa: Zarejestrowani
Postów: 208
Pomógł: 3
Dołączył: 13.07.2009
Skąd: Tarnów

Ostrzeżenie: (0%)
-----


Witam,
zastanawiam się jak uprościć usuwanie znaków specjalnych i części liter.
Do tej pory używam bardzo łopatologicznej metody:

  1. $tresc_intake = str_replace(" ", "", $tabelka2[1]);
  2. $tresc_intake = str_replace(" ", "", $tresc_intake);
  3. $tresc_intake = str_replace(" ", "", $tresc_intake);
  4. $tresc_intake = str_replace(" ", "", $tresc_intake);
  5. $tresc_intake = str_replace("XXXXXXXXX", "", $tresc_intake);
  6. $tresc_intake = str_replace("0000000000", "", $tresc_intake);
  7. $tresc_intake = str_replace("-", "", $tresc_intake);
  8. $tresc_intake = str_replace("/", "", $tresc_intake);
  9. $tresc_intake = str_replace("*", "", $tresc_intake);
  10. $tresc_intake = str_replace(",", "", $tresc_intake);
  11. $tresc_intake = str_replace(".", "", $tresc_intake);
  12. $tresc_intake = str_replace("_", "", $tresc_intake);
  13. $tresc_intake = str_replace("!", "", $tresc_intake);
  14. $tresc_intake = str_replace("Q", "", $tresc_intake);
  15. $tresc_intake = str_replace("q", "", $tresc_intake);
  16. $tresc_intake = str_replace("I", "", $tresc_intake);
  17. $tresc_intake = str_replace("i", "", $tresc_intake);


Czy jest możliwość ustalenia tego w ramach tablicy lub innego sposobu?
Poza tym jak mogę uniknąć głupich wpisów typu "11111111111111111" czy "XXXXXXXXX"?
Z góry dziękuję za pomoc.

Ten post edytował d0m1n1k_ 31.10.2015, 13:01:41


--------------------
Prywatna koncepcja pasji - SprawdzAuto.info
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 17:10