Skip to content

Jean-Pierre Lambelet

Il n'y a pas de questions bêtes

FREN
  • Articles
  • Categories
    • AI / LLM
    • Docker
    • Git
    • PHP
    • SQL
    • WordPress
  • About
FREN
crayon et gomme

Tomasz Sienicki, CC BY 3.0

PHP

PHP – Delete Special Characters

August 17, 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 run a LIKE query with WP_Query
PHP – Replace accented characters with their unaccented equivalents

About

Jean-Pierre Lambelet is a Swiss software engineer focused on LLMs. This blog collects tips and tutorials on generative AI and RAG chatbots, PHP and Symfony, PostgreSQL and Docker.

Recent Posts

  • An LLM crawler that said “ok” for 12 days and extracted nothing
  • Docker – pgvector – Run PostgreSQL with pgvector in Docker Compose
  • PostgreSQL – pgvector – Keep the ivfflat index when you give results a weight
  • Stopping a RAG chatbot from presenting stale information as current
  • Giving a chatbot live weather through LLM tool calling
  • FR
  • EN

Recent Posts

  • An LLM crawler that said “ok” for 12 days and extracted nothing
  • Docker – pgvector – Run PostgreSQL with pgvector in Docker Compose
  • PostgreSQL – pgvector – Keep the ivfflat index when you give results a weight
© 2026 Jean-Pierre Lambelet • RSS feed • Privacy Policy • Ads fund this blog,