Anglais Francais Prosygma 

Italie
-
    hebergement 

asp
prosygma_logo



 Divers (1)  Chaînes (31)  Dates (18)  Nombres (8)  Structures (5) 
 Tableaux (6) 
asc/ord - chr - crunch - cstr/(string) - dosql/addslashes - ereg_replace - htmlspecialchars - instr/strpos - instrrev/strrpos - lcase/strtolower - left - len/strlen - ltrim - mid/substr - nl2br - notag - parcelstr - password - replace/str_replace - right - rtrim - space - string/str_repeat - tarea/htmlentities - trim - ucase/strtoupper - ucfirst - undosql/stripslashes - urldecode - urlencode - wrapstr
WRAPSTR 
Intercale des espaces dans la chaîne pour former des mots de longueur maximum
ASP
<%
function wrapstr(ch,lg)
   Set regEx = New RegExp
   regEx.Global = True
   regEx.Pattern = "([^ \n\r]{"&lg&"})"
   wrapstr = regEx.replace(ch,"$1 ")
end function

response.write wrapstr(chaine,longueur)
%>

PHP
<?
function wrapstr($ch,$lg) {
   $reg = "([^ \n\r]{".$lg."})";
   return ereg_replace($reg,"\\1 ",$ch);
}

echo wrapstr($chaine,$longueur);
?>

JavaScript
<script>
function wrapstr(ch,lg) {
   var reg = new RegExp("([^ \n\r]{"+lg+"})","g")
   return ch.replace(reg,"$1 ")
}

document.write(wrapstr(chaine,longueur))
</script>

© ASP-PHP.net 11/01/2003