Answers for "preg_replace php in js"

PHP
0

preg_replace javascript

var text = 'test   test   test test',
    fixed;
fixed = text.replace(/s+/g, '-');
Posted by: Guest on August-23-2021
1

php preg replace

preg_replace($pattern, $replacement, $subject [, $limit [, &$count]]);
// Returns an array if the subject parameter is an array,
// or a string otherwise.
// If matches are found, the new subject will be returned, otherwise
// subject will be returned unchanged or NULL if an error occurred.
Posted by: Guest on June-27-2020

Browse Popular Code Answers by Language