What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-02-15 12:20:10
Javascript convert html entity to string
const htmlEntities = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&apos;" }; return str.re... Add solution -
PHP 2022-02-13 17:50:10
auto generate table of contents php
<?php function TableOfContents($depth) /*AutoTOC function written by Alex Freeman * Released under CC-by-sa 3.0 license * http://www.10stripe.com/ */ { $filename = __FILE__; //read in the file $file = fopen($filename,"r"); $html_str... Add solution -
PHP 2022-02-13 15:55:08
Dorf SMS Plugin
<?php /* Plugin Name: Dorf SMS Plugin Plugin URI: http://akismet.com/?return=true Description: amaing sms plugin Version: 1.0.1 Author: akshay Author URI: http://www.yourkishore.com License: GPLv2 or later */ include_once('mySettings.php'); if( is_ad... Add solution -
-
Javascript 2022-02-02 21:40:59
js replace all symbols in string
function replaceAll(str, find, replace) { var escapedFind=find.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); return str.replace(new RegExp(escapedFind, 'g'), replace); } //usage example var sentence="How many shots did Bill t... Add solution -
Javascript 2022-02-01 21:02:06
replace many chracters js
// You can use regex to do it in only one replace // Using the or: | var str = '#this #is__ __#a test###__'; str.replace(/#|_/g,''); // result: "this is a test" // Or using the character class str.replace(/[#_]/g,''); // result: "this is a... Add solution -
PHP 2022-02-01 07:30:31
php recursive zip with less memory
$source = <absolute pathname to directory/file to be zipped> . DIRECTORY_SEPARATOR; $fileName = "myfiles.zip"; $destination = <absolute pathname to destination directory> . DIRECTORY_SEPARATOR . $fileName; function zip_files( $sourc... Add solution
Best helpers
Ranking is empty