Skip to content

Instantly share code, notes, and snippets.

View rgen3's full-sized avatar

Alexander Tanaev rgen3

View GitHub Profile
<?php
$string = 'thisIsCamelAAACase';
$result = preg_replace_callback(
'/(?P<some>[A-Z]+)(?P<name>[A-Z])|(?<![A-Z])(?P<name>[A-Z])/J',
function($m) { return strtolower("_" . (empty($m['some']) ? '' : $m['some'] . '_') . $m['name']); },
$string
);
<?php
class a
{
public function exportClick()
{
echo $i = 0, PHP_EOL;
$params = [];
$items = [];
<?php
$levels = [
['word'],
['concat', 'two'],
['others', 'the others']
];
function concat(array $array, $concat = '', $result = []) {
$current = array_shift($array);
domain=$1
iteration=1
if [ $domain = '']
then
domain=your_default_domain_here
fi
while true;
do
sleep 1s