Hello World Program in C Get link Facebook X Pinterest Email Other Apps February 16, 2019 #include <stdio.h> int main() { printf("Hello World!"); return 0; } Get link Facebook X Pinterest Email Other Apps Comments
A variable variable in PHP July 15, 2019 <?php $varname = 'tireqty'; $$varname = 100; echo $tireqty; // output: 100 ?> Read more
Calling a function using variable name in PHP July 15, 2019 <?php function show_name() { echo 'Rangan Roy'; } $var = 'show_name'; $var(); // output: Rangan Roy ?> Read more
Replace every instance of a substring in PHP March 08, 2019 <?php if(isset($_GET['submit'])) { if(strlen($_GET['text']) && strlen($_GET['search_for']) && strlen($_GET['replace_with'])) { $text = $_GET['text']; $search_for = $_GET['search_for']; $replace_with = $_GET['replace_with']; $offset = 0; $search_for_length = strlen($search_for); $replace_with_length = strlen($replace_with); $text = ' '.$text; // that's how search position will never be 0 while($search_for_position = strpos($text, $search_for, $offset)) { $text = substr_replace($text, $replace_with, $se... Read more
Comments
Post a Comment