Voting

: max(zero, five)?
(Example: nine)

The Note You're Voting On

robert at broofa dot com
17 years ago
Some recipes for switching between underscore and camelcase naming:
<?php
// underscored to upper-camelcase
// e.g. "this_method_name" -> "ThisMethodName"
preg_replace('/(?:^|_)(.?)/e',"strtoupper('1ドル')",$string);
// underscored to lower-camelcase
// e.g. "this_method_name" -> "thisMethodName"
preg_replace('/_(.?)/e',"strtoupper('1ドル')",$string);
// camelcase (lower or upper) to underscored
// e.g. "thisMethodName" -> "this_method_name"
// e.g. "ThisMethodName" -> "this_method_name"
strtolower(preg_replace('/([^A-Z])([A-Z])/', "1ドル_2ドル", $string));
?>

Of course these aren't 100% symmetric. For example...
 * this_is_a_string -> ThisIsAString -> this_is_astring
 * GetURLForString -> get_urlfor_string -> GetUrlforString

<< Back to user notes page

AltStyle によって変換されたページ (->オリジナル) /