base64 encode using javascript

We can encode any string to a encoded data (using base-64 encoding) string.
The btoa() method of window object used to to a encoded data (using base-64 encoding) string.
Example :

window.btoa(‘Hello World !!!’);

Output : SGVsbG8gV29ybGQgISEh

Use Facebook to Comment on this Post

cookie and subdomains

A cookie can be set either for a specific domain or a domain and its subdomain. Cookie for a specific domain: When you set a cookie from a web server in php using setcookie() function then this function accepts some parameters. Some parameters are required and some are optional. In those parameters there is one…


How iowait impacts System performance System or any server’s performance heavily depends on IOPS. And if MySql is running on the System, it requires disk of high IOPS. Lots of select queries running simultaneously cause high iowait if disk dont have high IOPS. High iowait means cpu is waiting for I/O access. That increase the…

APC Cache

As APC is used for speeding up php sites it by caching php. But many times we face caching problem. We need to clear php cache. It is easy to clear cache from web url but many of us dont know that apc cache can not be cleared from CLI mode. For command line ,…

PHP Best Practise

Always use PHP standard tags i.e.  <?php ?> .  To ensure the future version support, Please use standard tags for PHP. Always follow a consistent naming standards. Always use Indent and white spaces in codes. It helps to read and understand the code. Always turn on the full error reporting for development. It will show…

Output buffering in php

Output buffering is used by PHP to improve performance and to perform a few tricks. Without output buffering (the default), your HTML is sent to the browser in pieces as PHP processes through your script. With output buffering, your HTML is stored in a variable and sent to the browser as one piece at the…

Ternary Operators

This operator takes three arguments – a condition, a result for true, and a result for false. It is a shortcut of doing if statements. Here’s an example: $result = ($a < 16) ? 'true' : 'false'; if ($a < 16) { $result = 'true'; } else { $result = 'false'; }