Changeset 21 in tests for wp-testlib/utils.php
- Timestamp:
- 09/22/2007 02:44:11 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-testlib/utils.php
r11 r21 5 5 function rand_str($len=32) { 6 6 return substr(md5(uniqid(rand())), 0, $len); 7 } 8 9 // strip leading and trailing whitespace from each line in the string 10 function strip_ws($txt) { 11 $lines = explode("\n", $txt); 12 $result = array(); 13 foreach ($lines as $line) 14 if (trim($line)) 15 $result[] = trim($line); 16 17 return trim(join("\n", $result)); 7 18 } 8 19
Note: See TracChangeset
for help on using the changeset viewer.