Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php normalize whitespace characters

<?php

function normalizeWhitespaceCharacters( $string )
{
    $stepOne = htmlentities($string);
    $stepTwo = trim(preg_replace('/(&nbsp;)+|sKs+/','', $stepOne));
    $final = html_entity_decode($stepTwo);
    return $final;
}
Source by gist.github.com #
 
PREVIOUS NEXT
Tagged: #php #normalize #whitespace #characters
ADD COMMENT
Topic
Name
4+1 =