Friday, October 28, 2016

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]);
?>






Here is the output

PHP Regular Expressions





Author - 
sudhir k gupta | sudhir gupta | sudhir kumar gupta | eghara
Sudhir K gupta | Lonawala

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

Tuesday, September 20, 2016

How to check a value exists in javascript array

Lets say user send a input "abcd" or "123". Now i want to check that incoming input should be  valid as assign in javascript array.

Like this -:



And you want output like this



var validFormatsArray = ['varchar','email','int','phone','sudhir'];
var isValidFormat = $.inArray('int'.toLowerCase(), validFormatsArray);

if(isValidFormat == -1){
  alert('Invalid format detected');
}else{
  alert('valid format');
}

Checkout this video tutorial







Also Read-:

Top most 15 haunted places in india which will dread your body



Sunday, September 18, 2016

How to translate one word to all possible language in single click

This trick will work in google spreadsheets only.


1) open a blank (new) google docs spreadsheet
2) add this to cell B2:
=GoogleTranslate($A$1, "en", "af")
3) Copy the formula entered into B2 to as many rows you want, one for each language.
4) replace the "af" (afrikaans) with whatever language codes you want in the formulas below B2 ... google has 149 languages to pick from. See here: Google Language Codes - tomihasa
5) Enter the stuff you want translated into cell A1




Saturday, September 17, 2016

How to use google voice in chrome (awesome tricks)

1. How do you turn on voice search on Google Chrome?
2. What is the Voice Search?
3. How do I use voice commands?



must watch and learn how to use effectively google voice in your computer using chrome