What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-11-08 15:23:09
php strip url of all invalid characters
//replaces all invalid characters in a url with "-" function url($url) { $url = preg_replace('~[^\\pL0-9_]+~u', '-', $url); $url = trim($url, "-"); $url = iconv("utf-8", "us-ascii//TRANSLIT", $url); $url... Add solution -
PHP 2021-11-04 11:52:10
php keep only numbers in string
$str = preg_replace('/[^0-9.]+/', '', $str); Add solution -
PHP 2021-10-27 05:42:10
generate seo friendly url from string in php
<?php /** * Generate a URL friendly "slug" from a given string. * * @param string $title * @param string $separator * @return string */ function slug($title, $separator = '-') { // convert String to Utf-8 Ascii $title = iconv(mb_d... Add solution -
PHP 2021-10-25 20:36:06
Remove All Spaces Out of a String in PHP
phpCopy<?php $searchString = " "; $replaceString = ""; $originalString = "This is a programming tutorial"; $outputString = preg_replace('/\s+/', '', $originalString); echo("The original string is: $originalString... Add solution
Best helpers
Ranking is empty