This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$str = 'V2UgZG8gd2hhdCBtYXR0ZXJzIHRoZSBtb3N0ISE='; | |
echo base64_decode($str); | |
# output : We do what matters the most!! | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$str = 'We do what matters the most!!'; | |
echo base64_encode($str); | |
# output : V2UgZG8gd2hhdCBtYXR0ZXJzIHRoZSBtb3N0ISE= | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$str = '?5V4@;6]V92!F87-T(&%N9"!B<F5A:R!T:&EN9W,A(0``'; | |
error_log(convert_uudecode($str)); | |
# output : We move fast and break things!! | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$str = 'We move fast and break things!!'; | |
error_log(convert_uuencode($str)); | |
# output : ?5V4@;6]V92!F87-T(&%N9"!B<F5A:R!T:&EN9W,A(0`` | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo urlencode("https%3A%2F%2Fcanopas.com%3Fdata%3Dtest"); | |
# output : https://canopas.com?data=test | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo urlencode("https://canopas.com?data=test"); | |
# output : https%3A%2F%2Fcanopas.com%3Fdata%3Dtest | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$str = "<a href='https://canopas.com'>Let's explore</a>"; | |
echo html_entity_decode($str); // in browser | |
error_log(html_entity_decode($str)); // in console | |
/* | |
output | |
In browser : Let's explore | |
In console : <a href='https://canopas.com'>Let's explore</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$str = "<a href='https://canopas.com'>Let's explore</a>"; | |
echo htmlentities($str); // in browser | |
error_log(htmlentities($str)); // in console | |
/* | |
output | |
In browser : <a href='https://canopas.com'>Let's explore</a> | |
In console : <a href='https://canopas.com'>Let's explore</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myFunc("John"); | |
function myFunc(name) { | |
console.log("My name is " + name); //My name is John | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sum(...args) { | |
let sum = 0; | |
for (let arg of args) { | |
sum += arg; | |
} | |
return sum; | |
} | |
// can pass any number of arguments |