PHP slugify test

static public function slugify($text) { // replace non letter or digits by – $text = preg_replace(‘~[^\\pL\d]+~u’, ‘-‘, $text); // trim $text = trim($text, ‘-‘); // transliterate $text = iconv(‘utf-8’, ‘us-ascii//TRANSLIT’, $text); // lowercase $text = strtolower($text); // remove unwanted characters $text = preg_replace(‘~[^-\w]+~’, ”, $text); if (empty($text)) { return ‘n-a’; } return $text; } OR […]

Making sure PHP substr finishes on a word not a character

t could be done with a regex, something like this will get up to 260 characters from the start of string up to a word boundary: $line=$body; if (preg_match(‘/^.{1,260}\b/s’, $body, $match)) { $line=$match[0]; } OR $s = substr($string, 0, 261); $result = substr($s, 0, strrpos($s, ‘ ‘)); Rerence:

Titanium Genymotion emulator 255 error

This issue may be adb incompatibility with the newest version of the platform SDK. The best solution for this issue with Genymotion is to set the Android SDK within Genymotion to your location. This can be found within the Settings page. Simply, just set “use custom Android SDK tools” in Settings -> ADB of Genymotion, […]

Google Maps Multiple Markers

Generate SH1 For android

Command for generate :

1 2 3 4 5