sangkrit

Free Access

Any mobile device running on android for accessing this homeschool program of internet age SANGKRIT.net, could always get reviewed here if that simplifies the process in the hands of our users.

Contact: System at Sangkrit dot Net

Move Across WordPress Draft, Pending And Publish Post Statuses

Don’t use register_post_status before init. Register Post Status is a function used to create and modify post status based on given parameters. register_post_status() function is located in wp-includes/post.php It accepts following two parameters:

$post_status means a string for the post status name $args means an array of arguments

<?php register_post_status( $post_status, $args ); [...]

PHP Array Functions

PHP Array functions need no installation. These functions are the part of PHP core.

array_change_key_case — It changes all keys in an array array_chunk — It split an array into chunks array_combine — It creates an array by using one array for keys and other for its values array_count_values — It counts all [...]

Function: print_r

This function allows you to print the contents of any variable, including a constructed object and an array. <?php $variable=”Hello World”; print_r($variable);

$array=array(‘a’, ‘c’, ‘d’, ‘b’); print_r($array); ?>

Returns

Hello World

Array ( [0] => a [1] => c [2] => d [3] => b )

You can also utilize this to print out all [...]

What is Require Once Statement

The require_once() statement includes the specific file during the script executiont. This statement is similar to the require() statement, with the difference is that if the code from a file which is already included, will not be included again.

require_once() is used in cases where the same file might be included and evaluated more than [...]

What is Require Statement

If the error occurs, the require statement generates a fatal error and stops the script execution.For example:

<html>

<body>

<?php

require (“lamp.php”);

/*Here the script will stop if the file given with the require statement in the above line doesn’t exists*/

echo (“This is lamp”);

?>

</body>

</html>

PHP: Include

The include statement allows you to include and attach other PHP scripts to your own script. You can think of it as a simply taking the included file and inserting them into your PHP file.

For example:

<?php

function add ($x, $y)

{

return $x + $y;

}

?>

Using include function:

<?php

include (‘add.php’);

[...]

Accessing Global Variables From Any Function

From one function we cannot access a variable defined in other function.

Given example defines a variable in the script but the function will not take that during execution process.

<?php

// Function will not access this variable

$num = 11;

function number () {

echo “The number is “.$num;

}

number ();

?>

When [...]