Skip to main content

Posts

Showing posts from 2023

សីល សទ្ធា បញ្ញា

ឥស្សរសូត្រ

PHP The global Keyword

  PHP The global Keyword The  global  keyword is used to access a global variable from within a function. To do this, use the  global  keyword before the variables (inside the function): <!DOCTYPE html> <html> <body> <?php $x = 5; $y = 10; function myTest() {   global $x, $y;   $y = $x + $y; }  myTest();  // run function echo $y; // output the new value for variable $y ?> </body> </html> *************** the same result as below *************** <!DOCTYPE html> <html> <body> <?php $x = 5; $y = 10; function myTest() {   $GLOBALS['y'] = $GLOBALS['x'] + $GLOBALS['y']; }  myTest(); echo $y; ?> </body> </html> ============= output is 15

Global and Local scope

  Global and  Local scope code bellow: ------------- <!DOCTYPE html> <html> <body> <?php $x = 5; // global scope   function myTest() {   $x = 55; // local scope   echo "<p>Variable x inside function is: $x</p>"; }  myTest(); echo "<p>Variable x outside function is: $x</p>"; ?> </body> </html> ------------- output:  Variable x inside function is: 55 Variable x outside function is: 5

Help in CMD

C:\Users\somet>help For more information on a specific command, type HELP command-name ASSOC          Displays or modifies file extension associations. ATTRIB         Displays or changes file attributes. BREAK          Sets or clears extended CTRL+C checking. BCDEDIT        Sets properties in boot database to control boot loading. CACLS          Displays or modifies access control lists (ACLs) of files. CALL           Calls one batch program from another. CD             Displays the name of or changes the current directory. CHCP           Displays or sets the active code page number. CHDIR          Displays the name of or changes the current directory. CHKDSK         Checks a disk and displays a status report. CHKNTFS ...