PHP remove all symbols from string

How to remove all symbol to string only in PHP, use preg_replace:

preg_replace('/[^\p{L}\p{N}\s]/u','', $x)

Sample remove all symbol end characters:

<?php
$x=’SSS abc saple sym@ “” 1 <> CK2‘;
echo $str = preg_replace(‘/[^\p{L}\p{N}\s]/u’,”, $x);?>

Result:

SSS abc saple sym 1 CK2

READ :  Teknologi Ajax Jadikan Website, Situs Lebih Cepat
Topic : Website
Penulis : Andreas

Publisher konten, aktif membuat artikel informatif membantu pembaca memahami tren terbaru secara lebih jelas dan mudah dipahami.

Editor : SEOSatu

Bertanggung jawab atas proses penyuntingan, verifikasi serta memastikan konten akurat, relevan, dan sesuai standar kualitas.