Posts

Showing posts with the label Others

Virtual Host setup in XAMPP

1. xampp\apache\conf\extra\httpd-vhosts.conf <VirtualHost *:80>     ServerAdmin hasib.dev     DocumentRoot "C:/xampp/htdocs/hasib/"     ServerName hasib.dev </VirtualHost> 2.Windows\System32\drivers\etc\hosts 127.0.0.1 hasib.dev

How to add a program to startup

-> Create a shortcut of your program (.exe file) from root directory -> Go to run command -> Write (%appdata%) and run -> Now to to this directory from the (AppData->Roaming) window -> Directory : (Microsoft\Windows\Start Menu\Programs\Startup) -> Cut and Paste your created shortcut file in this directory -> Restart You PC -> Is it Done Successfully ???

Basic difference for subtraction with two formula

 Formula 1 :                    387                    -98                   ------                   289 1st step we borrow 1/(10) from 8 and then make 7 into 17. (17-8=9). 2nd step we add borrowed 1 with 9 and again borrow 1/(10) from 2. (18-10=8). 3rd step we subtract  borrowed 1 from 3. (3-1=2). ______________________________________________________________ Formula 2 :                  387                  -98        ...

Call by reference in php OOP

<?php     class a{         public function calc(&$a,&$b){             return $a+$b;         }     }     $obj = new a();         $v1=2;         $v2=4;     echo $obj->calc($v1,$v2); ?> When you will pass value by reference then remember you must have to use '&' sing in parameter with variable as like as the example given up.

Regular Expression

1. ([a-z]+) this expression will count a word from small a to small z. Such as according to this code which is given below. <?php     $preg = "aAAAA Bbbbb bbbbb bbbbbb";     echo preg_replace("([a-z]+)", "1", $preg); ?> You will get this output '1AAAA B1 1 1'. 2. ([a-z]) this expression will count a single character from small a to small z. Such as according to this code which is given below. <?php     $preg = "aAAAA Bbbbb bbbbb bbbbbb";     echo preg_replace("([a-z])", "1", $preg); ?> You will get this output '1AAAA B1111 11111 111111'.

php preg_replace

preg_replace is a function which is use in regular expression. <?php     $preg = "aAAAA Bbbbb";     echo preg_replace("([a-z])", "1", $preg); ?> There $preg is a variable and we stored some strings in this variable. preg_replace(); function is a builtin function which has three parameters. First parameter is for regular expression condition, the second one is for required output, and the last and third parameter is to select the variable that in which variable you want to apply preg_replace() function.