is it possible in laravel to change string like this:
"This Is String" to "this-is-string" ?
In laravel doc. I have only found this:
$snake = snake_case('fooBar');
// foo_bar
Thank you very much for your help :)
is it possible in laravel to change string like this:
"This Is String" to "this-is-string" ?
In laravel doc. I have only found this:
$snake = snake_case('fooBar');
// foo_bar
Thank you very much for your help :)
If you want to do it in Laravel though, you could call:
Str::slug('This Is String');
For more info visit API: http://laravel.com/api/source-class-Illuminate.Support.Str.html#247-270
I don't know Laravel but you can try this :
<?php
$string = "This Is String"
$string = strtolower(str_replace(" ", "-", $string)); // "this-is-string"
?>
try this :
return Str::slug('This Is String');
//this-is-string
doc : http://three.laravel.com/docs/strings / http://laravel.com/api/source-class-Illuminate.Support.Str.html#247-270