Remove all attributes from HTML tags in PHP
$text = '<div class="test"><p onmousemove="javascript:alert(1);">Clean <a href="#">text</a></p></div>';
$cleanText = preg_replace("/<([a-z][a-z0-9]*)[^>]*?(\/?)>/si",'<$1$2>', $text);
Also in PHP:
- autoload.php
- clear cache laravel web
- cusatom time format to timestamp php
- class name laravel
- catch multiple exceptions php
- charctar count php
- character length in php
- create random string and number with laravel
- body field yml drupal config
- find a specific word in a string and add another string after that specific word php
- date class in php
- Failed at the @ development script. laravel dev
- command line read line by line
- error correction in qr code php
- creat folder in php
- check if astring is apart of another string in php
- find contact page url by domain list php
- $ php artisan route list
- CHANGE MAX EXECUTION IN PHP
- convert json to array php
- comparacion cache laravel
- WooCommerce Add Long Description to Products on Shop Page with Character limit
- php timestamp to date
- check key in array php