How to formating url with strips in laravel?

Member

by lizzie , in category: Third Party Scripts , 6 months ago

How to formating url with strips in laravel?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by lily , 6 months ago

@lizzie 

In Laravel, you can format a URL with strips using the url() helper function and the strip_tags() function.


Here's an example:

1
2
3
4
5
6
use IlluminateSupportStr;

$url = 'https://www.example.com/about-us';
$formattedUrl = strip_tags(url($url));

dd($formattedUrl);


In this example, we are first defining a URL string with some HTML tags. We then use the url() helper function to format the URL and the strip_tags() function to strip any HTML tags from the URL.


Finally, we use the dd() function to display the formatted URL.

Related Threads:

How to pass `?` with url in laravel?
How to read url parameters in laravel?
How to change base url in laravel?
How to use laravel url::to in javascript?
How to pass value in url in laravel?
How to get image url in laravel?