Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php remove anchor tag from string

$text = "<a href='http://www.google.com/'>Google1</a><br>" .
        "<a>Google2</a><br>" .
        "<afaketag href='http://www.google.com'>Google2</afaketag><br>" .
        "<afaketag>Google4</afaketag><br>" . 
        "<a href='http://www.google.com'><img src='someimage.jpg'></a>";
echo preg_replace("/</?a( [^>]*)?>/i", "", $text);
Comment

PREVIOUS NEXT
Code Example
Php :: get count laravel 
Php :: register_post_type wordpress 
Php :: get all category custom post type wordpress dev 
Php :: php convert object to array nested 
Php :: get data in array formate in Laravel 
Php :: laravel migration index 
Php :: Convert String to Date and Date-Time in PHP 
Php :: how to redirect to another page in php 
Php :: wordpress get current taxonomy 
Php :: php zeilenumbruch 
Php :: concat in where clause laravel query builder 
Php :: get value by today yesterday in laravel 
Php :: Str laravel 9 
Php :: wordpress get post body 
Php :: laravel asset 
Php :: Notice: Trying to access array offset on value of type int in /var/www/pdam/modules/phpexcel/PHPExcel/Cell/DefaultValueBinder.php on line 82 
Php :: search post by post title in wordpres 
Php :: for in php 
Php :: get_the_author_meta display name 
Php :: laravel redirect to intended page after register 
Php :: alerta con php 
Php :: File Reading Modes PHP 
Php :: how to cheeck php 
Php :: How to reset phpmyadmin username and password 
Php :: php exec without waiting 
Php :: livewire inline component 
Php :: laravel show debug query sql 
Php :: generate laravel event 
Php :: laravel validation regex 
Php :: laravel handle queryexception 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =