Make WordPress Core

Changeset 21 in tests for wp-testlib/utils.php


Ignore:
Timestamp:
09/22/2007 02:44:11 AM (18 years ago)
Author:
tellyworth
Message:

add test_wp_dropdown_users

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testlib/utils.php

    r11 r21  
    55function rand_str($len=32) {
    66    return substr(md5(uniqid(rand())), 0, $len);
     7}
     8
     9// strip leading and trailing whitespace from each line in the string
     10function 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));
    718}
    819
Note: See TracChangeset for help on using the changeset viewer.