<?php
//题目要求:输入格式为"get-element-by-id"的任意字符串,将其转换为驼峰命名的字符串,例如getElementById/
//例如:$str = “get-element-by-id”;
$str = "get-element-by-id";
$arr = explode('-',$str);
for($i=1;$i<count($arr);$i++) {
$arr[$i] = ucfirst($arr[$i]);
}
$str = implode('',$arr);
echo $str;
?>