This file contains 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 | |
$arr = array( | |
1=>'satu', | |
2=>'dua', | |
3=>'tiga', | |
); | |
echo current($arr)."<br />"; | |
echo next($arr)."<br />"; | |
echo next($arr)."<br />"; |
This file contains 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 | |
function array_insert(&$array, $value, $index){ | |
return $array = array_merge(array_splice($array, max(0, $index - 1)), array($value), $array); | |
} | |
$arr = array(1,2,3,4); | |
$more = array('nama', 'address'); | |
array_splice($arr, 2, 0, array($more)); | |
echo "<pre>"; |
This file contains 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 | |
$arr = array( | |
'ayam', | |
'angsa', | |
'bebek', | |
'ayam', | |
'itik', | |
'angsa', | |
); |
This file contains 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 | |
$arrai = array('1'=>'banana', '2'=>'orange'); | |
array_unshift($arrai, 'watermelon'); | |
echo "<pre>"; | |
print_r($arrai); | |
?> |
This file contains 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 | |
function autoload($className) | |
{ | |
$className = ltrim($className, '\\'); | |
$fileName = ''; | |
$namespace = ''; | |
if ($lastNsPos = strripos($className, '\\')) { | |
$namespace = substr($className, 0, $lastNsPos); | |
$className = substr($className, $lastNsPos + 1); | |
$fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; |
This file contains 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 | |
function add_b_tags(&$item) | |
{ | |
//$item = "<b>$item</b>"; | |
$item = explode(" ", $item); | |
$r = array(); | |
foreach($item as $i){ | |
$r[] = "<b>".$i."</b>"; |
This file contains 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
<?=$s=trim('Hello World');for(;$c=$s[$i++];printf("%$l.s".$s[-$i+$l=strlen($s)],$c))?><?=strrev($s); |
This file contains 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
import requests | |
from bs4 import BeautifulSoup as Sup | |
page_url = "http://www.bi.go.id/biweb/Templates/Moneter/Default_Kurs_EN.aspx?NRMODE=Published&NRNODEGUID=%7bEC4BBAA9-A1A8-4A4F-AC22-EDDA954C1B6A%7d&NRORIGINALURL=%2fweb%2fen%2fMoneter%2fKurs%2bBank%2bIndonesia%2fKurs%2bTransaksi%2f&NRCACHEHINT=Guest" | |
payload = { | |
'__VIEWSTATE' : 'dDw3MjU3NDM1OTQ7dDw7bDxpPDA+O2k8MT47PjtsPHQ8cDxsPFRleHQ7PjtsPGRlZmF1bHQgLSBDZW50cmFsIEJhbmsgb2YgUmVwdWJsaWMgb2YgSW5kb25lc2lhOz4+Ozs+O3Q8O2w8aTwxPjtpPDI+O2k8MTQ+Oz47bDx0PHA8bDxUZXh0Oz47bDxcPGltZyBzcmM9Ii9iaXdlYi9SZXNvdXJjZXMvaW1hZ2VzL2hlYWRfdGl0bGVfbW9uZXRlcl9lbi5naWYiXD47Pj47Oz47dDxwPGw8VGV4dDs+O2w8XDxpbWcgc3JjPSIvYml3ZWIvUmVzb3VyY2VzL2ltYWdlcy9oZWFkX2lsbHVzdHJhdGlvbl9tb25ldGVyLmpwZyJcPjs+Pjs7Pjt0PDtsPGk8MD47aTwyPjs+O2w8dDxwPGw8VmlzaWJsZTs+O2w8bzxmPjs+PjtsPGk8MT47aTwzPjtpPDU+O2k8Nz47aTw5PjtpPDExPjs+O2w8dDxwPGw8VmlzaWJsZTs+O2w8bzxmPjs+PjtsPGk8MT47PjtsPHQ8cDxsPFZpc2libGU7PjtsPG88Zj47Pj47Oz47Pj47dDxwPGw8VmlzaWJsZTs+O2w8bzxmPjs+PjtsPGk8MT47aTwzPjtpPDU+O2k8Nz47aTw5PjtpPDExPjtpPDEzPjt |
This file contains 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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<style> | |
body { | |
margin: 0px; | |
padding: 0px; | |
} | |
#container { | |
background-color: black; |