Skip to content

Instantly share code, notes, and snippets.

View crynobone's full-sized avatar
🖥️
Working

Mior Muhammad Zaki crynobone

🖥️
Working
View GitHub Profile
<?php
$string_create = 'create_some_long_tablename';
$string_add = 'add_some_tablename_to_other_long_table_name';
function get($string) {
$string = str_replace(array('create_', 'add_','_to_'), array('create-', 'add-', '-to-'), $string);
if (preg_match('/^(create|add)\-([A-Za-z0-9\_]*)(\-to\-)?([A-Za-z0-9\_]*)?$/i', $string, $matches)) {
if ($matches[1] == 'create') {