What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-10-22 18:51:12
php convert link to embed youtube
function convertYoutube($string) { return preg_replace( "/\s*[a-zA-Z\/\/:\.]*youtu(be.com\/watch\?v=|.be\/)([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i", "<iframe src=\"//www.youtube.com/embed/$2\&qu... Add solution -
PHP 2021-10-20 09:42:09
php make text id attribute safe
function seoUrl($string) { //Lower case everything $string = strtolower($string); //Make alphanumeric (removes all other characters) $string = preg_replace("/[^a-z0-9_\s-]/", "", $string); //Clean up multiple dashes or white... Add solution -
PHP 2021-10-18 13:49:08
string to lowercase accentuation hyphenated
<?php /** * Converts string to SEO-friendly form (lowercase hyphenated alphanumeric words) * * @param $string * @return string */ function seoUrl($string) { // qv stackoverflow.com/questions/11330480, stackoverflow.com/questions/1017599 ... Add solution -
PHP 2021-10-18 03:28:04
php get embed code from youtube url
function convertYoutube($string) { return preg_replace( "/\s*[a-zA-Z\/\/:\.]*youtu(be.com\/watch\?v=|.be\/)([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i", "<iframe src=\"//www.youtube.com/embed/$2\&qu... Add solution -
PHP 2021-10-14 13:37:08
python to php
Depending on what you are doing, system() or popen() may be perfect. Use system() if the Python script has no output, or if you want the Python script's output to go directly to the browser. Use popen() if you want to write data to the Python script's sta... Add solution -
PHP 2021-10-13 17:56:11
php function to minify javascript and css
$css = ''; $root = $_SERVER['DOCUMENT_ROOT'].'/css/'; //directory where the css lives $files = explode(',',$_SERVER['QUERY_STRING']); if(sizeof($files)) { foreach($files as $file) { $css.= (is_file($root.$file.'.css') ? file_get_contents($root.$file.'... Add solution -
Other 2021-10-10 06:23:05
custom function for woocommerce price format
/** * Format price to WooCommerce standards * * @access public * @param float $price * @return string */ public function format_price($price) { $num_decimals = absint(get_option('woocommerce_price_num_decimals')); $currency_symbo... Add solution -
PHP 2021-10-09 15:57:06
convert any phone number in us number format php
$numbers = explode("\n", '(111) 222-3333 ((111) 222-3333 1112223333 111 222-3333 111-222-3333 (111)2223333 +11234567890 1-8002353551 123-456-7890 -Hello! +1 - 1234567890 '); foreach($numbers as $number) { print preg_replace('~.*... Add solution
Best helpers
Ranking is empty