Skip to content

Jean-Pierre Lambelet

Il n'y a pas de questions bêtes

  • Programming tips
  • General tips
  • About
  • EN
    • FR
    • EN
MacBook avec code sur un bureau

Photo de Christopher Gower sur Unsplash

PHP – Delete Special Characters

April 29, 2026September 2, 2013 by Jean-Pierre Lambelet

To effectively remove special characters in a string, just use the preg_replace method.

$string - preg_replace ('[^a-zA-Z0-9]/s', '', $string);
Categories PHP
WordPress – How to make a quere like – "%%"
PHP – Replace accents with their counterparts.

À propos

Jean-Pierre Lambelet est un développeur web suisse. Ce blog rassemble ses astuces et tutoriels sur PHP, Symfony, Drupal, Docker et l'outillage de développement front-end.

Recent Posts

  • Giving a chatbot live weather through LLM tool calling
  • RAG explained to my mum
  • A Chrome extension to find unanswered WhatsApp chats
  • LLM – System prompt – Prevent contact hallucination with a registry
  • PostgreSQL – How to filter on a column with uppercase letters in its name
  • FR
  • EN

Recent Posts

  • Giving a chatbot live weather through LLM tool calling
  • RAG explained to my mum
  • A Chrome extension to find unanswered WhatsApp chats
© 2026 Jean-Pierre Lambelet • RSS feed • Privacy Policy