$string = 'The quick brown fox jumped over the lazy dog.';$patterns = array();$patterns[2] = '/quick/';$patterns[1] = '/brown/';$patterns[0] = '/fox/';$patterns[4] = '/lazy/';var_dump($patterns);$replacements = array();$replacements[0] = 'lazyo';$rep…
使用函数array_keys(),得到数组中所有的键,参数:数组 $arr=array();$arr['one']="one";$arr['two']="two";$arr['three']="three";$newArr=array_keys($arr);print_r($newArr);//Array ( [0] => one [1] => two [2] => three ) 使用函数array_values(),得到数组…
//java中创建包用package相当于C#的命名空间namespace,java中导入包用import相当于C#中引入命名空间usingimport java.util.*;//导入包,*代表导入java.util包下面的所有类public class Test { /***********Scanner的使用************/// public static void main(String[] args) {// Scanner input = new Scanner(Syst…