Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php replace spaces with dash

str_replace(' ', '-', $string);
Comment

php replace space with dash

<?php 
  $string = "hello php";
  $replace = str_replace(" ", "_", $string);
  echo $replace; // hello_php
?>
Comment

php replace all spaces with dashes

// Clean up multiple dashes or whitespaces
$string = preg_replace("/[s-]+/", " ", $string);
// Convert whitespaces and underscore to dash
$string = preg_replace("/[s_]/", "-", $string);
Comment

PREVIOUS NEXT
Code Example
Php :: dummy data in laravel 
Php :: laravel migration index 
Php :: populate old value of dropdown laravel 
Php :: php isset post 
Php :: lluminate/contracts[v5.6.0, ..., 5.8.x-dev] require php ^7.1.3 - your php version (8.0.10) does not satisfy that requirement. 
Php :: acf repeater 
Php :: migrate specific file laravel 
Php :: php zeilenumbruch 
Php :: php random number generator 
Php :: how delete the table in laravel in the commend 
Php :: why pusher not working in laravel 
Php :: turn off deprecated warnings php 
Php :: laravel drop table column 
Php :: snap store phpstrom 
Php :: php mysql search database and display results 
Php :: laravel foreach iteration 
Php :: how get the Photo size upload in laravel 
Php :: part of url php 
Php :: order by in datatable laravel 
Php :: php iterate thru object 
Php :: Laravel retrieving single record 
Php :: laravel collection keys 
Php :: how to use plugin shortcode in wordpress template 
Php :: validation error laravel 8 with custom massage 
Php :: sanctum auth check? 
Php :: redirect compact laravel 
Php :: xampp to test on mobile 
Php :: wp_create_user 
Php :: phpmyadmin reset auto_increment 
Php :: eloquent update row response 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =