Here's a PHP function that takes a string as input and returns an array of words:

function splitString($input) {
    $words = preg_split('/\s+/', $input);
    return $words;
}

Now, you can call this function with your input string "abc d aa an 3" and it will return ["abc", "d", "aa", "an", "3"].

make php function for me input abc d aa an 3 return abc d aaan3

原文地址: https://www.cveoy.top/t/topic/iqMj 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录