I want remove HTML tags (all) from a string on laravel blade ... code
output (example)
I want that it be like this
asked Mar 27, 2016 at 12:34
hassen zouarihassen zouari 8112 gold badges10 silver badges17 bronze badges 1 Try to use
http://php.net/manual/en/function.strip-tags.php Update: Try to do something like this in a controller:
Then pass this variable into a blade template and use it instead of answered Mar 27, 2016 at 12:40
Alexey MezeninAlexey Mezenin 152k23 gold badges277 silver badges263 bronze badges 1 You can use strip_tags($yourString); to strip the html tags. In blade you could achieve this by
hope that is helpful :) answered Mar 27, 2016 at 12:42
Sahith VibudhiSahith Vibudhi 4,5032 gold badges27 silver badges30 bronze badges 1 As for me, I use this construction:
I hope, my code was helpful for somebody) answered Jun 2, 2017 at 7:34
You can use
linktoahref 7,3263 gold badges29 silver badges48 bronze badges answered Feb 7, 2018 at 11:50
upendraupendra 3093 silver badges19 bronze badges Add the below code into your helpers
& use this in your blade
answered Dec 23, 2016 at 13:13
WahseiWahsei 2492 gold badges5 silver badges14 bronze badges you must know about the diffrence between 1.1) laravel have predefined you can load variable exact value by using or 1.2)laravel loading with strip remove please take it seriously this qustion answer its protect your website from cross site scripting excecution.for example if user save his name but he puted script alert.then if you using core php and not handling the strip tags then this script excution when page laod so i give you some more harmful example 1)like i puted my name as script or in a about section and in script i write some code who get the browser cookies of open website and curl request for saving on my server. so you understand this whats happen if i got the each user cookies by curl and i just puted a cross script in about filed and its saved in database.
Cody Gray♦ 233k50 gold badges482 silver badges559 bronze badges answered Nov 23, 2019 at 13:32
just by doing this answered Nov 10, 2018 at 15:48
3 use this in your code $allcms = json_decode(strip_tags(Cms::where('status','active')->get()),true);
answered Dec 19, 2019 at 4:44
This will solve your issue
answered Jul 23 at 9:33
ABDOABDO 1001 silver badge6 bronze badges PHP 8.1 and from Laravel 9, we can do this:
answered Sep 24 at 19:15
|