very basic code which we use offten in our day to day development and sometime we stucked . i write those issue here with simple solution. You will get codes of html, css, javascript, jquery, json,ajax, node.js, vue.js, nuxt.js, php and Mysql
Sunday, January 1, 2017
Friday, October 28, 2016
How to find how many parameter / Arguments has been passed and there value
code-
<?php
function parentFunction($name='name') {
echo "There are total: ".func_num_args()." Arguments passed.<BR>";
$args = func_get_args();
echo '<pre>';
print_r($args);
echo '</pre>';
//fetch the value
for($i = 0; $i < count($args); $i++) {
echo "Passed Value: {$args[$i]}<br />";
}
}
parentFunction($name= 'name','email','phone','location');
?>
<?php
function parentFunction($name='name') {
echo "There are total: ".func_num_args()." Arguments passed.<BR>";
$args = func_get_args();
echo '<pre>';
print_r($args);
echo '</pre>';
//fetch the value
for($i = 0; $i < count($args); $i++) {
echo "Passed Value: {$args[$i]}<br />";
}
}
parentFunction($name= 'name','email','phone','location');
?>
login authentcation via browser prompt using PHP
Extract Only numbrs from long string using Regex with PHP (Regular Expressions)
Here is a string -: RT4646R@TWBNSN3234FHFHFH893892389FHDJJD$
Now How will find all red marked numbers in an Array.Here is solution.
<?php
$string = 'RT4646R@TWBNSN3234FHFHFH893892389FHDJJD$';
$special_char = '\[#$%^&*()+=\-\[\]\';,.\/{}|":<>?~\\\\]';
preg_match_all('/\d+/', $string,$output);
echo '<pre>';
print_r($output[0]);
?>
Labels:
number regex,
Regex,
regular expressions,
string regex
Tuesday, September 27, 2016
Convert All Table TD data into Titlecase with 1 line of code
Lets say.. you receive input from server and that input is unstructured. No proper title case.
Just like this.
And You want like this (in just one click or unload )
Here is the code (Copy link is below the screenshot)
Download Full Code From Here
Subscribe to:
Posts (Atom)


