number_format() Function in Php

#Number Format Function in PHP

 

The number_format() function formats a number with grouped thousands.

 

Note: This function supports one, two, or four parameters (not three).

 

Syntax::

Syntax:

number_format(number,decimals,decimalpoint,separator)

 

Parameters::

ParameterDescription
numberRequired. The number to be formatted. If no other parameters are set, the number will be formatted without decimals and with comma (,) as the thousands separator.
decimalsOptional. Specifies how many decimals. If this parameter is set, the number will be formatted with a dot (.) as decimal point
decimalpointOptional. Specifies what string to use for decimal point
separatorOptional. Specifies what string to use for thousands separator. Only the first character of separator is used. For example, “xxx” will give the same output as “x”

Note: If this parameter is given, all other parameters are required as well

 

Example:

//Option-1
echo number_format("1000000")."<br>";

Output: 1,000,000


// Option-2
echo number_format("1000000",2)."<br>";

Output::1,000,000.00


//Option-3
echo number_format("1000000",2,",",".");

Output:: 1.000.000,00

 

How to Update the Current Browser URL

# UPDATE THE CURRENT URL IN BROWSER::
<script>

ChangeUrl = function(page, url) {

    if (typeof (history.pushState) != "undefined") {

        var obj = { Page: page, Url: url };

        history.pushState(obj, obj.Page, obj.Url);

        $('.breadcrumb-get-a-pro').attr('href', url);

    } else {

        alert("Browser does not support HTML5.");

    }

}

</script>

Meta Tags for Search Engine Optimization

Meta Tags for Search Engine Optimization
# Meta Tags used for seo::
<meta name="description" content="Stackofcodes is a blog for Learners, Developers, designers. "/>

<meta name="robots" content="noimageindex,noarchive,nosnippet"/>

<link rel="canonical" href="//www.stackofcodes.in/" />




<meta property="og:locale" content="en_US" />

<meta property="og:type" content="article" />

<meta property="og:title" content="Pricing | Kissmetrics" />

<meta property="og:description" content="Get, keep and grow more customers with Kissmetrics Customer Engagement Automation platform. Built for eCommerce marketers and product teams." />




<meta property="og:url" content="https://www.stackofcodes.in/" />

<meta property="og:site_name" content="Kissmetrics" />

<meta property="og:image" content="" />

<meta property="og:image:secure_url" content="" />

<meta property="og:image" content="" />

<meta property="og:image:secure_url" content="" />




<meta name="twitter:card" content="summary" />

<meta name="twitter:description" content="Stackofcodes is a blog for Learners, Developers, designers." />

<meta name="twitter:title" content="Stackofcodes" />

<meta name="twitter:image" content="" />