本文整理汇总了PHP中Str::lcfirst方法的典型用法代码示例。如果您正苦于以下问题:PHP Str::lcfirst方法的具体用法?PHP Str::lcfirst怎么用?PHP Str::lcfirst使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Str
的用法示例。
在下文中一共展示了Str::lcfirst方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __callStatic
/**
* Make the actual API call via curl
*
* @param string $method API method that has been called
* @param array $arguments Arguments that have been passed to it
* @throws Exception
* @return object The response object
*/
public static function __callStatic($method, $arguments = array())
{
if (strpos($method, '_')) {
// underscore method has been used, make it CamelCase
$method = \Str::lcfirst(\Inflector::camelize($method));
}
$default_params = array('apikey' => static::$api_key);
$extra_params = empty($arguments) ? $arguments : array_shift($arguments);
$params = array_merge($default_params, $extra_params);
curl_setopt_array(static::$_connection, array(CURLOPT_URL => static::$api_url . $method, CURLOPT_POSTFIELDS => http_build_query($params)));
$response = json_decode(curl_exec(static::$_connection));
if (@$response->error) {
throw new \FuelException('Error #' . $response->code . ': ' . $response->error);
}
return $response;
}
示例2: test_lcfirst
/**
* Test for Str::lcfirst()
*
* @test
*/
public function test_lcfirst()
{
$output = Str::lcfirst('Hello World');
$expected = "hello World";
$this->assertEquals($expected, $output);
}