œ_#ÁÕ§TE NAŒ“KeÉ:”(åŽÖJÞùY’‚ñùž7; «]Û ý`8g“¯B© jdÖÖ¸ðzœ¸¦4Ç3Kó^(ÍÖ¼ Õ€pvìwšõB4df$Èü^0˜…åÌC$#2FŽÑ§±¦ÛZ/÷š&m£ñzÒÖ ’.Î]!Î;ƒ(Õ–¢d/—#Kª+tZyuÏB>NÛÖ†(¸ŒSà'³„Y˜´-_•¦¼´˜OlNK§¶ÒàŠˆTHµƒeTPå·fïM’…þuÏÍüp6دªE£åü‡ZØ'CKF#â«;‹eyO Qp„†l"ö1èíÙP ÏŒúl! BÝ2ñª•_VÁÉ÷3eu`–F¸ìI--ö<¿žë¯4õ캿¢)34Å{wMÉ2ÆÖFŸ¥`e9Ú¶¸P‡.”FÔï rY ‚²ÈTB,{ÛœéJ}«àQ4¹0Rû4D‚B§S‘ dO•v¾„™Sן¯3FeŸ™«+ÓâwH dÕÛÌì·P4ë&¥#rÜÉ Ù¦ê†ý·xòqk¯2,¹§™E\ék‚×Sá”ÚºÙ⺷ö£6…à ʾ qSá³Å|;àû}4Ÿ($â¹VY~óÍ!èÜÒŒËX½Ù1j‚VíÍŸš³+œ]«½g{_{/vµ½\¢¶vÉWKÿ:ñám½ ¥ S²x‘t ŽšÝÙÿÀÇ^ný PK IW™k‚½÷ á _rels/.relsUT dìd dìd dìd’ÏNÃ0‡ï{ŠÈ÷ÕÝ@¡¥» ¤Ý*`%îÑ&QâÁöö‚J£ì°cœŸ¿|¶²ÙÆA½rL½wVE Šñ¶w†çúay * 9Kƒw¬áÈ ¶ÕbóÄIîI]’Ê—4t"á1™ŽGJ…ìòMããH’±Å@æ…ZÆuYÞ`üÍ€jÂT;«!îì T}|Û7MoøÞ›ýÈNN<|v–í2ÄÜ¥ÏèšbË¢Ázó˜Ë )„"£OÏ7ú{ZYÈ’yÞç#1'tuÉM?6o>Z´_å9›ëKÚ˜}?þ³žÏÌ·N>fµx PK IWª½e ¢ U € word/document.xmlUT dìdPK IWþË3” z €J¢ word/settings.xmlUT dìdPK IWC‡{š' ƒ €¤ docProps/custom.xmlUT dìdPK IW츱=Œ €‡¥ [Content_Types].xmlUT dìdPK IWV%ë±" €U§ docProps/app.xmlUT dìdPK IW€RŒ 3 €¶¨ docProps/core.xmlUT dìdPK IWkòDn ô €ª word/_rels/document.xml.relsUT dìdPK IW;$î €Î« word/fontTable.xmlUT dìdPK IW+åäz] ÷. €ý¬ word/numbering.xmlUT dìdPK IW¤2×r- ¿ €›° word/styles.xmlUT dìdPK IWMFÒ ø €´ word/header1.xmlUT dìdPK IWF— T e €· word/media/image1.jpegUT dìdPK IW!Yéáå €°Ë word/media/image2.pngUT dìdPK IW°Àºë ú €ÙÌ word/media/image3.pngUT dìdPK IW$“†ª L €Î word/footer1.xmlUT dìdPK IWzaGôM €ñÑ word/footer2.xmlUT dìdPK IW–µâº P €}Õ word/theme/theme1.xmlUT dìdPK IW™k‚½÷ á €{Û _rels/.relsUT PK ! bîh^ [Content_Types].xml ¢( ¬”ËNÃ0E÷HüCä-Jܲ@5í‚Ç*Q>Àēƪc[žiiÿž‰ûB¡j7±ÏÜ{2ñÍh²nm¶‚ˆÆ»R‹ÈÀU^7/ÅÇì%¿’rZYï @1__f› ˜q·ÃR4DáAJ¬h>€ãÚÇV߯¹ªZ¨9ÈÛÁàNVÞ8Ê©ÓãÑÔji){^óã-I‹"{Üv^¥P!XS)bR¹rú—K¾s(¸3Õ`cÞ0†½ÝÎß»¾7M4²©ŠôªZÆk+¿|\|z¿(Ž‹ôPúº6h_-[ž@!‚ÒØ Pk‹´2nÏ}Ä?£LËð Ýû%áÄßdºždN"m,à¥ÇžDO97*‚~§Èɸ8ÀOíc|n¦Ñ äEøÿöéºóÀBÉÀ!$}‡íàÈé;{ìÐå[ƒîñ–é2þ ÿÿ PK ! µU0#ô L _rels/.rels ¢( ¬’MOÃ0†ïHü‡È÷ÕÝBKwAH»!T~€Iܵ£$Ý¿'TƒG½~üÊÛÝ<êÈ!öâ4¬‹;#¶w†—úqu *&r–Fq¬áÄvÕõÕö™GJy(v½*«¸¨¡KÉß#FÓñD±Ï.W ¥†=™ZÆMYÞbø®ÕBS톰·7 ê“Ï›×–¦é ?ˆ9LìÒ™ÈsbgÙ®|Èl!õùUSh9i°bžr:"y_dlÀóD›¿ý|-NœÈR"4ø2ÏGÇ% õZ´4ñËyÄ7 ëÈðÉ‚‹¨Þ ÿÿ PK ! Q48wÛ — xl/workbook.xml¤UÙnâ0}iþ!cñ‡ *–¢AšVU×$dC¬&vÆv UÕŸë@XÊK§/¹p|Žï¹N÷b“¥Ö •Š ÞC¸î"‹òHÄŒ¯zèá~b·‘¥4á1I§=ôJºèÿüÑ] ù¼âÙ ®z(Ñ:GE ͈ª‹œrˆ,…̈†©\9*—”Ä*¡Tg©ã¹nàd„q´Eåg0ÄrÉ":Q‘Q®· ’¦D}•°\UhYô¸ŒÈç"·#‘å ±`)Ó¯%(²²(œ®¸d‘‚ì nZ w v¡ñª• t¶TÆ")”Xê:@;[Ògú±ë`|²›ó=ø’ïHúÂL÷¬dðEVÁ+8€a÷Ûh¬Uz%„Íû"ZsÏÍCýî’¥ôqk]‹äù5ÉL¦Rd¥Dé˘i÷P ¦bM/|dÉ",…¨çãFNoçiûéë>aêiçsó#ðÄ ÕTr¢éHp ÜIú®ÝJìQ"ÀÜÖ-ý[0I¡¦ÀZ Z…d¡nˆN¬B¦=4 g %PDF-1.4 %âãÏÓ 3 0 obj << /Linearized 1 /L 422775 ÿØÿà JFIF ÿÛ C ÿÛ C ÿÀ X" ÿÄ ÿÄ H !1A"Qaq2‘¡#±ÁBRÑ3Cbrá$S‚¢²ð4ñ%6DTc’ÂsÿÄ ÿÄ = !1AQ"aq‘Á2R¡±BÑð#3br’²4á$‚¢ÂñÿÚ ? áHBßÝ`„! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! !@B„ „! ! stream
<!DOCTYPE html>
<!-- saved from url=(0074)https://www.w3schools.com/php/phptryit.asp?filename=tryphp_class_constant2 -->
<html lang="en-US"><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><script type="text/javascript" async="" src="./W3Schools Tryit Editor_files/publishertag.prebid.js.download"></script><script async="" src="./W3Schools Tryit Editor_files/wrap.js.download"></script><script type="text/javascript" async="" src="./W3Schools Tryit Editor_files/localstore.js.download"></script>
<title>W3Schools Tryit Editor</title>
<meta name="viewport" content="width=device-width">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="og:image" content="https://www.w3schools.com/images/w3schools_logo_436_2.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="436">
<meta property="og:image:height" content="228">
<meta property="og:title" content="W3Schools online PHP editor">
<meta property="og:description" content="The W3Schools online code editor allows you to edit code and view the result in your browser">
<link rel="stylesheet" href="./W3Schools Tryit Editor_files/w3schools.css">
<link rel="icon" href="https://www.w3schools.com/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="https://www.w3schools.com/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://www.w3schools.com/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="https://www.w3schools.com/favicon-16x16.png">
<link rel="manifest" href="https://www.w3schools.com/site.webmanifest" crossorigin="use-credentials">
<link rel="mask-icon" href="https://www.w3schools.com/safari-pinned-tab.svg" color="#04aa6d">
<meta name="msapplication-TileColor" content="#00a300">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="./W3Schools Tryit Editor_files/codemirror.css">
<script type="text/javascript" src="./W3Schools Tryit Editor_files/config.js.download" async=""></script><script type="text/javascript" async="" src="./W3Schools Tryit Editor_files/js"></script><script src="./W3Schools Tryit Editor_files/f.txt"></script><script async="" src="./W3Schools Tryit Editor_files/gtm.js.download"></script><script src="./W3Schools Tryit Editor_files/codemirror.js.download"></script>
<script src="./W3Schools Tryit Editor_files/codemirror_htmlmixed.js.download"></script>
<script src="./W3Schools Tryit Editor_files/codemirror_javascript.js.download"></script>
<script src="./W3Schools Tryit Editor_files/codemirror_css.js.download"></script>
<script src="./W3Schools Tryit Editor_files/codemirror_clike.js.download"></script>
<script src="./W3Schools Tryit Editor_files/codemirror_php.js.download"></script>
<!-- Google Tag Manager -->
<script>
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-KTCFC3S');
var subjectFolder = location.pathname;
subjectFolder = subjectFolder.replace("/", "");
if (subjectFolder.startsWith("python/") == true ) {
if (subjectFolder.includes("/numpy/") == true ) {
subjectFolder = "numpy/"
} else if (subjectFolder.includes("/pandas/") == true ) {
subjectFolder = "pandas/"
} else if (subjectFolder.includes("/scipy/") == true ) {
subjectFolder = "scipy/"
}
}
subjectFolder = subjectFolder.substr(0, subjectFolder.indexOf("/"));
</script>
<!-- End Google Tag Manager -->
<script src="./W3Schools Tryit Editor_files/uic.js.download"></script>
<script src="./W3Schools Tryit Editor_files/uic_prov.js.download"></script>
<script data-cfasync="false" type="text/javascript">
uic_prov_pre("tryit","",subjectFolder);
if (window.addEventListener) {
window.addEventListener("resize", browserResize);
} else if (window.attachEvent) {
window.attachEvent("onresize", browserResize);
}
var xbeforeResize = window.innerWidth;
function browserResize() {
var afterResize = window.innerWidth;
if ((xbeforeResize < (970) && afterResize >= (970)) || (xbeforeResize >= (970) && afterResize < (970)) ||
(xbeforeResize < (728) && afterResize >= (728)) || (xbeforeResize >= (728) && afterResize < (728)) ||
(xbeforeResize < (468) && afterResize >= (468)) ||(xbeforeResize >= (468) && afterResize < (468))) {
xbeforeResize = afterResize;
uic_prov_run();
}
if (window.screen.availWidth <= 768) {
restack(window.innerHeight > window.innerWidth);
}
fixDragBtn();
showFrameSize();
}
var fileID = "";
</script><script type="text/javascript" async="" src="./W3Schools Tryit Editor_files/loader.js.download"></script>
<style>
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
color:#000000;
margin:0px;
font-size:100%;
}
.trytopnav {
height:48px;
overflow:hidden;
min-width:380px;
position:absolute;
width:100%;
top:99px;
background-color:#E7E9EB;
}
.topnav-icons {
margin-right:8px;
}
.trytopnav a,.trytopnav button {
color:#999999;
}
.w3-bar .w3-bar-item:hover {
color:#757575 !important;
}
a.w3schoolslink {
padding:0 !important;
display:inline !important;
}
a.w3schoolslink:hover,a.w3schoolslink:active {
text-decoration:underline !important;
background-color:transparent !important;
}
#dragbar{
position:absolute;
cursor: col-resize;
z-index:3;
padding:5px;
}
#shield {
display:none;
top:0;
left:0;
width:100%;
position:absolute;
height:100%;
z-index:4;
}
#framesize {
font-family: 'Montserrat', 'Source Sans Pro', sans-serif;
font-size: 14px;
}
#container {
background-color:#E7E9EB;
width:100%;
overflow:auto;
position:absolute;
top:144px;
bottom:0;
height:auto;
}
#textareacontainer, #iframecontainer {
float:left;
height:100%;
width:50%;
}
#textarea, #textarea2, #iframe {
height:100%;
width:100%;
padding-bottom:10px;
padding-top:1px;
}
#textarea {
padding-left:10px;
padding-right:5px;
}
#iframe {
padding-left:5px;
padding-right:10px;
position:relative;
color:#ffffff;
font-family: "Times New Roman";
}
#textareawrapper {
width:100%;
height:100%;
overflow:auto;
background-color: #ffffff;
position:relative;
box-shadow:0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
#iframewrapper {
width:100%;
height:100%;
-webkit-overflow-scrolling: touch;
background-color: #ffffff;
box-shadow:0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
color:#ffffff;
font-family: "Times New Roman";
font-size: 16px;
}
#textareaCode, #textareaCode2 {
background-color: #ffffff;
font-family: consolas,Menlo,"courier new",monospace;
font-size:15px;
height:100%;
width:100%;
padding:8px;
resize: none;
border:none;
line-height:normal;
}
/*
.localhostcontainer {
position:absolute;
width:auto;
right:0;
left:0;
z-index:2;
padding:4px 12px;
border-bottom:1px solid #d9d9d9;
background-color:#E7E9EB;
}
.localhostdiv {
overflow:hidden;
font-family:arial;
border:1px solid #d9d9d9;
background-color:#fff;
font-size:14px;
padding-left:10px;
}
*/
.localhostoutercontainer {
position: absolute;
width: auto;
left:5px;
right:10px;
background-color: #E7E9EB;
height: 30px;
z-index: 9;
}
.localhostoutercontainer.horizontal {
left:10px;
}
.localhostcontainer {
position:relative;
width:auto;
right:0;
left:0;
z-index:2;
xpadding:6px 12px;
xxborder-bottom:1px solid #d9d9d9;
background-color:#F1F1F1;
background-color:#38444d;
border-top-right-radius:10px;
border-top-left-radius:10px;
overflow:hidden;
padding-top:4px;
}
.localhostdiv {
overflow:hidden;
font-family:arial;
color:#000;
background-color:#fff;
font-size:15px;
padding-left:10px;
border-radius:20px;
width:60%;
float:left;
font-family: consolas,Menlo,"courier new",monospace;
}
.localhostbuttoncontainer {
width:20%;
min-width:100px;
color:#ffc107;
float:left;
font-size:16px;
overflow:auto;
}
div.localhostbuttoncontainer span{
display:inline-block;
color:#ffc107;
position:relative;
padding-bottom:4px;
padding-left:2px;
}
div.localhostbuttoncontainer span:first-child{
color:#dc3545;
padding-left:12px;
}
div.localhostbuttoncontainer span:last-child{
color:#04AA6D;
padding-left:2px;
}
body.darktheme .localhostoutercontainer {
background-color: #38444d;
}
body.darktheme .localhostcontainer {
background-color:rgb(21,32,43)
}
body.darktheme .localhostdiv {
border:1px solid #595959;
background-color:#ffffff;
}
/**/
#filenamecontainer {
position:absolute;
text-align:center;
z-index:4;
width:100%;
}
#filenamecontainer span {
opacity:0.9;
padding:1px 6px;
font-family:Consolas;
background-color:#E7E9EB;
font-size:16px;
}
body.darktheme #filenamecontainer span {
background-color:#555555;
color:#E7E9EB;
}
.CodeMirror.cm-s-default {
line-height:normal;
padding: 4px;
height:100%;
width:100%;
}
#iframeResult, #iframeSource {
background-color: #ffffff;
color:#000;
font-family: "Times New Roman";
padding:8px;
height:100%;
width:100%;
}
#iframeResult * {
font-family: "Times New Roman"!important;
}
#iframeResult h1,#iframeResult h2,#iframeResult h3,#iframeResult h4,#iframeResult h5,#iframeResult h6 {
font-weight: bold;
}
#stackV {background-color:#999999;}
#stackV:hover {background-color:#BBBBBB !important;}
#stackV.horizontal {background-color:transparent;}
#stackV.horizontal:hover {background-color:#BBBBBB !important;}
#stackH.horizontal {background-color:#999999;}
#stackH.horizontal:hover {background-color:#999999 !important;}
#textareacontainer.horizontal,#iframecontainer.horizontal{
height:50%;
float:none;
width:100%;
}
#textarea.horizontal{
height:100%;
padding-left:10px;
padding-right:10px;
}
#iframe.horizontal{
height:100%;
padding-right:10px;
padding-bottom:10px;
padding-left:10px;
}
#container.horizontal{
min-height:200px;
margin-left:0;
}
#tryitLeaderboard {
overflow:hidden;
text-align:center;
margin-top:5px;
height:90px;
}
.w3-dropdown-content {width:350px}
#breadcrumb ul {
font-family:'Montserrat', 'Source Sans Pro', sans-serif;
list-style: none;
display: inline-table;
padding-inline-start: 1px;
font-size: 12px;
margin-block-start: 6px;
margin-block-end: 6px;
}
#breadcrumb li {
display: inline;
}
#breadcrumb a {
float: left;
background: #E7E9EB;
padding: 3px 10px 3px 20px;
position: relative;
margin: 0 5px 0 0;
text-decoration: none;
color: #555;
}
#breadcrumb a:after {
content: "";
border-top: 12px solid transparent;
border-bottom: 12px solid transparent;
border-left: 12px solid #E7E9EB;
position: absolute;
right: -12px;
top: 0;
z-index: 1;
}
#breadcrumb a:before {
content: "";
border-top: 12px solid transparent;
border-bottom: 12px solid transparent;
border-left: 12px solid #fff;
position: absolute;
left: 0;
top: 0;
}
#breadcrumb ul li:first-child a:before {
display: none;
}
#breadcrumb ul:last-child li{
padding-right: 5px;
}
#breadcrumb ul li a:hover {
background: #04AA6D;
color:#fff;
}
#breadcrumb ul li a:hover:after {
border-left-color: #04AA6D;
color:#fff;
}
#breadcrumb li:last-child {
display: inline-block!important;
margin-top: 3px!important;
}
#runbtn {
background-color:#04AA6D;
color:white;
font-family: 'Source Sans Pro', sans-serif;
font-size:18px;
padding:6px 25px;
margin-top:4px;
border-radius:5px;
word-spacing:10px;
}
#runbtn:hover {
background-color: #059862 !important;
color:white!important;
}
#getwebsitebtn {
background-color:#04AA6D;
font-family: 'Source Sans Pro', sans-serif;
color: white;
font-size: 18px;
padding:6px 15px;
margin-top:4px;
margin-right: 10px;
display: block;
float: right;
border-radius: 5px;
}
#getwebsitebtn:hover {
background-color: #059862 !important;
color:white!important;
}
@media screen and (max-width: 727px) {
.trytopnav {top:70px;}
#container {top:116px;}
#breadcrumb {display:none;}
#tryhome {display:block;}
}
@media screen and (max-width: 467px) {
.trytopnav {top:60px;}
#container {top:106px;}
.w3-dropdown-content {width:100%}
}
@media only screen and (max-device-width: 768px) {
#iframewrapper {overflow: auto;}
#container {min-width:310px;}
.stack {display:none;}
#tryhome {display:block;}
.trytopnav {min-width:310px;}
}
#runloadercontainer{
display:none;
position:absolute;
background-color:#000;
z-index:9;
}
#runloader{
margin:auto;
border: 10px solid #333;
border-top: 10px solid #04AA6D;
border-radius: 50%;
max-width: 150px;
max-height: 150px;
animation: spin 2s linear infinite;
position:relative;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
#iframewrapper {
}
/*
.tabs-container {
height:100%;
overflow:auto;
}
.tabs {
list-style-type: none;
padding: 0;
margin: 0;
background-color:#E7E9EB;
}
.tab {
padding: 5px 10px;
background: #ddd;
width: fit-content;
display: inline-block;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.tab.active {
background: #fff;
}
.tab-pane {
display: none;
}
.tab-pane.active {
display: block;
}
*/
.tabitem, #resttab {
position:absolute;
z-index:2;
font-family: Consolas, 'Source Code Pro', Menlo, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
padding:4px 15px;
width:70px;
cursor:pointer;
}
/*
#progqcstab {
width:120px;
left:0;
}
#prog2qcstab {
width:100px;
left:120px;
}
#childtemplatetab {
width:150px;
left:220px;
}
*/
.tabitem {
background-color:lightgray;
color:#000;
border-top-left-radius:5px;
border-top-right-radius:5px;
border: 1px solid #E7E9EB;
border-bottom:none;
}
#resttab {
cursor:default;
z-index:1;
background-color:#E7E9EB;
border-bottom: 1px solid #E7E9EB;
width:100%;
left:0px;
}
.tabitem.tabselected{
background-color:#ffffff;
border: 1px solid #ffffff;
}
.tabitem:hover {
background-color:#bfbfbf;;
}
.tabitem.tabselected:hover {
background-color:#ffffff;;
}
.darktheme .tabitem {
background-color: #4b5b68;
color: #ffffff !important;
border: 1px solid #444;
border-bottom-color:rgb(21,32,43);
}
.darktheme .tabitem.tabselected{
background-color:rgb(21,32,43);
border: 1px solid rgb(21,32,43);
}
.darktheme .tabitem:hover {
background-color: #404e59;
}
.darktheme .tabitem.tabselected:hover{
background-color:rgb(21,32,43);
}
.darktheme #resttab {
background-color:#38444d;
border-bottom: 1px solid #38444d;
}
/**/
.fa {
padding: 10px 10px!important;
}
a.topnav-icons, a.topnav-icons.fa-home, a.topnav-icons.fa-menu, button.topnav-icons.fa-adjust {
font-size: 28px!important;
}
.darktheme #breadcrumb li {
color:#fff;
}
.darktheme #breadcrumb a {
background:#616161;
background-color:#38444d;
color: #ddd;
}
.darktheme #breadcrumb a:after {
border-left: 12px solid #616161;
border-left: 12px solid #38444d;
}
.darktheme #breadcrumb a:before {
border-left: 12px solid rgb(40, 44, 52);
border-left: 12px solid #1d2a35;
}
.darktheme .currentcrumb {
color:#ddd;
}
body.darktheme {
background-color:rgb(40, 44, 52);
background-color:#1d2a35;
}
body.darktheme #tryitLeaderboard{
background-color:rgb(40, 44, 52);
background-color:#1d2a35;
}
body.darktheme .trytopnav{
background-color:#616161;
background-color:#38444d;
color:#dddddd;
}
body.darktheme #container {
background-color:#616161;
background-color:#38444d;
}
body.darktheme .trytopnav a {
color:#dddddd;
}
body.darktheme #textareaCode {
background-color:rgb(40, 44, 52);
color:#fff;
}
body.darktheme #textareawrapper {
background-color:rgb(21,32,43);
}
body.darktheme .tabs {
background-color:#38444d;
}
body.darktheme .tab {
background: rgb(21,32,43);
color:#fff;
opacity:0.5;
}
body.darktheme .tab.active {
background: rgb(21,32,43);
color:#fff;
opacity:1;
}
body.darktheme ::-webkit-scrollbar {width:12px;height:3px;}
body.darktheme ::-webkit-scrollbar-track-piece {background-color:#000;}
body.darktheme ::-webkit-scrollbar-thumb {height:50px;background-color: #616161; background-color:#38444d;}
body.darktheme ::-webkit-scrollbar-thumb:hover {background-color: #aaaaaa;background-color: #4b5b68}
/*
#file1filetab, #resttab {
position:absolute;
z-index:2;
font-family:arial;
padding:4px 12px;
}
#file1filetab {
width:auto;
left:0;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
#resttab {
z-index:1;
background-color:#E7E9EB;
width:100%;
left:0px;
}
.tabitem {
background-color:#eaeaea;
}
.tabitem.tabselected{
background-color:#fff;
}
.darktheme .tabitem {
background-color:#444;
}
.darktheme .tabitem.tabselected{
background-color:rgb(21,32,43);
}
.darktheme #resttab {
background-color:#38444d;
}
*/
.darktheme #file1filetab {
border-right:1px solid rgb(21,32,43);
}
</style>
<!--[if lt IE 8]>
<style>
#textareacontainer, #iframecontainer {width:48%;}
#container {height:500px;}
#textarea, #iframe {width:90%;height:450px;}
#textareaCode, #textareaCode2, #iframeResult, .codewindow {height:450px;}
.stack {display:none;}
</style>
<![endif]-->
<script type="text/javascript" async="" src="./W3Schools Tryit Editor_files/prebid.js.download"></script><script type="text/javascript" async="" src="./W3Schools Tryit Editor_files/apstag.js.download"></script><script type="text/javascript" async="" src="./W3Schools Tryit Editor_files/f(1).txt"></script><script type="text/javascript" async="" src="./W3Schools Tryit Editor_files/adngin.js.download"></script><script type="text/javascript" async="" src="./W3Schools Tryit Editor_files/argus.js.download"></script><meta http-equiv="origin-trial" content="AlK2UR5SkAlj8jjdEc9p3F3xuFYlF6LYjAML3EOqw1g26eCwWPjdmecULvBH5MVPoqKYrOfPhYVL71xAXI1IBQoAAAB8eyJvcmlnaW4iOiJodHRwczovL2RvdWJsZWNsaWNrLm5ldDo0NDMiLCJmZWF0dXJlIjoiV2ViVmlld1hSZXF1ZXN0ZWRXaXRoRGVwcmVjYXRpb24iLCJleHBpcnkiOjE3NTgwNjcxOTksImlzU3ViZG9tYWluIjp0cnVlfQ=="><meta http-equiv="origin-trial" content="Amm8/NmvvQfhwCib6I7ZsmUxiSCfOxWxHayJwyU1r3gRIItzr7bNQid6O8ZYaE1GSQTa69WwhPC9flq/oYkRBwsAAACCeyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXN5bmRpY2F0aW9uLmNvbTo0NDMiLCJmZWF0dXJlIjoiV2ViVmlld1hSZXF1ZXN0ZWRXaXRoRGVwcmVjYXRpb24iLCJleHBpcnkiOjE3NTgwNjcxOTksImlzU3ViZG9tYWluIjp0cnVlfQ=="><meta http-equiv="origin-trial" content="A9wSqI5i0iwGdf6L1CERNdmsTPgVu44ewj8QxTBYgsv1LCPUVF7YmWOvTappqB1139jAymxUW/RO8zmMqo4zlAAAAACNeyJvcmlnaW4iOiJodHRwczovL2RvdWJsZWNsaWNrLm5ldDo0NDMiLCJmZWF0dXJlIjoiRmxlZGdlQmlkZGluZ0FuZEF1Y3Rpb25TZXJ2ZXIiLCJleHBpcnkiOjE3MzY4MTI4MDAsImlzU3ViZG9tYWluIjp0cnVlLCJpc1RoaXJkUGFydHkiOnRydWV9"><meta http-equiv="origin-trial" content="A+d7vJfYtay4OUbdtRPZA3y7bKQLsxaMEPmxgfhBGqKXNrdkCQeJlUwqa6EBbSfjwFtJWTrWIioXeMW+y8bWAgQAAACTeyJvcmlnaW4iOiJodHRwczovL2dvb2dsZXN5bmRpY2F0aW9uLmNvbTo0NDMiLCJmZWF0dXJlIjoiRmxlZGdlQmlkZGluZ0FuZEF1Y3Rpb25TZXJ2ZXIiLCJleHBpcnkiOjE3MzY4MTI4MDAsImlzU3ViZG9tYWluIjp0cnVlLCJpc1RoaXJkUGFydHkiOnRydWV9"><script src="./W3Schools Tryit Editor_files/f(2).txt" async=""></script><link href="https://securepubads.g.doubleclick.net/pagead/managed/dict/m202504010101/gpt" rel="compression-dictionary"><argprec0></argprec0><argprec1></argprec1><style type="text/css">.detachVideo > iframe{height:100%!important}.detachVideo{position:fixed;z-index:60000;bottom:150px;right:10px;min-height:180px;max-height:180px}</style><style type="text/css">.snigel-cmp-framework .sn-inner {background-color:#fffefe!important;}.snigel-cmp-framework .sn-b-def {border-color:#04aa6d!important;color:#04aa6d!important;}.snigel-cmp-framework .sn-b-def.sn-blue {color:#ffffff!important;background-color:#04aa6d!important;border-color:#04aa6d!important;}.snigel-cmp-framework .sn-selector ul li {color:#04aa6d!important;}.snigel-cmp-framework .sn-selector ul li:after {background-color:#04aa6d!important;}.snigel-cmp-framework .sn-footer-tab .sn-privacy a {color:#04aa6d!important;}.snigel-cmp-framework .sn-arrow:after,.snigel-cmp-framework .sn-arrow:before {background-color:#04aa6d!important;}.snigel-cmp-framework .sn-switch input:checked + span::before {background-color:#04aa6d!important;}#adconsent-usp-link {border: 1px solid #04aa6d!important;color:#04aa6d!important;}#adconsent-usp-banner-optout input:checked + .adconsent-usp-slider {background-color:#04aa6d!important;}#adconsent-usp-banner-btn {color:#ffffff;border: solid 1px #04aa6d!important;background-color:#04aa6d!important; }</style><style type="text/css">.sn_ad_label{height:unset !important}</style><style type="text/css">.snigel-adhesive{box-sizing:content-box;position:fixed;left:0;right:0;z-index:99999;text-align:center;padding-top:5px;padding-bottom:5px;background-color:#f2f6f7;transition:all 1500ms ease-out}.snigel-adhesive{text-align: -webkit-center;}.snigel-adhesive{text-align: -moz-center;}.snigel-adhesive.bottom{bottom:0}.snigel-adhesive.top{top:0}.snigel-adhesive-center{position:absolute;top:0;bottom:0;right:0;left:0}.snigel-adhesive-centered{position:absolute;margin:0;transform:translateY(-50%);right:0;left:0}.close-adhesive{box-sizing:content-box;width:16px;height:16px;position:absolute;right:0;padding:5px;background-color:#f2f6f7;text-align:center;cursor:pointer}.close-adhesive.bottom{top:0}.close-adhesive.top{bottom:0}.close-adhesive.bottom.extern{top:-21px;padding-bottom:0}.close-adhesive.top.extern{bottom:-21px;padding-top:0}.close-adhesive>svg{display:block}.close-adhesive-icon{fill:gray;stroke-width:3;stroke:#73d9c6}.logo-adhesive{cursor:pointer;opacity:0.65;position:absolute;left:5px;top:5px;width:24px;height:24px;background:url("https://cdn.snigelweb.com/resources/img/logo/snigel-icon-48.png") no-repeat 50% 50%/contain}.logo-adhesive:hover{opacity:1}.logo-adhesive.adhesive-hidden{left:-500px}</style><script src="./W3Schools Tryit Editor_files/3927" type="text/javascript" async="async"></script><script async="" src="./W3Schools Tryit Editor_files/22152718"></script><script src="./W3Schools Tryit Editor_files/pubcid.min.js.download"></script><script src="./W3Schools Tryit Editor_files/id5-api.js.download"></script><script async="" src="./W3Schools Tryit Editor_files/loader(1).js.download" id="idward-plugin-js" idw_client_id="MjI0OA==" idw_hide_button="true"></script><script async="" src="./W3Schools Tryit Editor_files/bundle.js.download" id="idward-plugin-js" idw_client_id="MjI0OA==" idw_hide_button="true"></script><style>@import url(https://fonts.googleapis.com/css2?family=Open+Sans:wght@500;600&display=swap);</style><style>#idw-plugin-container {
display: flex;
flex-direction: column;
box-sizing: content-box;
position: fixed;
left: -160px;
bottom: -160px;
z-index: 999999;
background-color: #fff;
height: auto;
max-width: 160px;
width: 160px;
min-width: 160px;
color: #171717;
line-height: 1rem;
outline: 1px solid #171717;
justify-content: flex-start;
-webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
opacity: 0;
transition: left .4s, bottom .4s, opacity .1s;
}
#idw-plugin-container.idw-open {
left: 0;
bottom: 0;
opacity: 1;
}
#idw-plugin-buttons {
display: flex;
flex-direction: column;
height: 100%;
width: auto;
}
#idw-plugin-container .pluginBtn {
border: none;
padding: 1px 5px !important;
margin: 0 !important;
width: auto !important;
height: 25px !important;
box-sizing: border-box !important;
border-radius: 0 !important;
text-align: right !important;
font-family: 'Open Sans', sans-serif !important;
line-height: normal !important;
text-transform: none !important;
letter-spacing: normal !important;
font-weight: 600 !important;
font-size: 14px !important;
background-color: #ffffff !important;
transition: background-color 0.2s;
cursor: pointer !important;
}
#idw-plugin-container .pluginBtn:hover {
outline: 1px solid #ffffff !important;
background-color: #171717 !important;
color: #ffffff !important;
}
#idw-open-trigger {
position: fixed;
width: 50px;
height: 50px;
bottom: 0;
left: 0;
z-index: 999999;
cursor: pointer;
-webkit-clip-path: polygon(100% 100%, 0 100%, 0 0);
clip-path: polygon(100% 100%, 0 100%, 0 0);
background-color: #171717 !important;
}
#idw-open-trigger img {
width: 28px;
height: 28px;
position: absolute;
/* padding: 4px; */
bottom: -2px;
left: -2px;
}</style><style>/***************/
/*MEDIA QUERIES*/
/***************/
/*
##Device: Tablets, Ipads (portrait)
##Screen: B/w 768px to 1024px
*/
@media (min-width: 768px) and (max-width: 1024px) {
}
/*
##Device: Most of the Smartphones Mobiles (Portrait)
##Screen: B/w 320px to 479px
*/
@media (min-width: 400px) and (max-width: 480px) {
}</style><style>
#idw-plugin-container .pluginBtn {
color: undefined !important;
}
#idw-plugin-container .pluginBtn:hover {
background-color: undefined !important;
}
#idw-open-trigger {
background-color: undefined;
}
</style></head>
<body>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KTCFC3S"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<div id="tryitLeaderboard">
<div id="adngin-try_it_leaderboard-0" data-google-query-id="CJ7624L0u4wDFdwmgwMdISIIHg"><div id="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//try_it_leaderboard_0__container__" style="border: 0pt none;"><iframe id="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//try_it_leaderboard_0" name="google_ads_iframe_/22152718,16833175/sws-hb//w3schools.com//try_it_leaderboard_0" title="3rd party ad content" width="728" height="90" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" aria-label="Advertisement" tabindex="0" allow="private-state-token-redemption;attribution-reporting" data-load-complete="true" data-google-container-id="1" style="border: 0px; vertical-align: bottom;" src="./W3Schools Tryit Editor_files/saved_resource.html"></iframe></div></div></div>
<div class="trytopnav">
<div class="w3-bar" style="overflow:auto">
<a id="tryhome" href="https://www.w3schools.com/" target="_blank" title="w3schools.com Home" class="w3-button w3-bar-item topnav-icons fa fa-home ga-tryit" style="margin-top:-2px;"></a>
<a href="javascript:void(0);" onclick="openMenu()" id="menuButton" title="Open Menu" class="w3-dropdown-click w3-button w3-bar-item topnav-icons fa fa-menu ga-tryit" style="margin-top:-2px;"></a>
<a href="javascript:void(0);" onclick="restack(currentStack)" title="Change Orientation" class="w3-button w3-bar-item w3-hide-small topnav-icons fa fa-rotate ga-tryit" style="margin-top:-2px;"></a>
<a href="javascript:void(0);" onclick="retheme()" title="Change Theme" class="w3-button w3-bar-item topnav-icons fa fa-adjust ga-tryit" style="margin-top:-2px;"></a>
<button id="runbtn" class="w3-button w3-bar-item w3-hover-white w3-hover-text-green ga-tryit" onclick="submitTryit(1);uic_prov_run();">Run ❯</button>
<a id="getwebsitebtn" class="w3-button w3-bar-item w3-hover-white w3-hover-text-green w3-hide-small ga-tryit" href="https://www.w3schools.com/spaces/" target="_blank">Get your <span class="w3-hide-medium"> own PHP</span> server</a>
<!--<span class="w3-right w3-hide-small xxw3-hide-medium" style="padding:8px 8px 8px 8px;display:block"></span>-->
<span class="w3-right w3-hide-small" style="padding:8px 16px 8px 0;display:block;float:right;font-size:16px;margin-top:4px"><span id="framesize">Result Size: <span>727 x 534</span></span></span>
</div>
</div>
<div id="shield" style="display: none;"></div>
<a href="javascript:void(0)" id="dragbar" style="width: 5px; top: 144px; left: 736.667px; height: 533.906px; cursor: col-resize;"></a>
<div id="container">
<div id="navbarDropMenu" class="w3-dropdown-content w3-bar-block w3-border" style="z-index:5">
<span onclick="openMenu()" class="w3-button w3-display-topright w3-transparent ws-hover-black" title="Close Menu" style="font-weight:bold;padding-top:10px;padding-bottom:11px;">�</span>
<div class="w3-bar-block">
<a class="w3-bar-item w3-button ga-tryit" href="javascript:void(0);" title="Change Orientaton" onclick="openMenu();restack(currentStack)"><i class="fa fa-rotate" style="font-size:26px;margin-left:-4px;margin-right:8px"></i><span style="position:relative;top:-4px;left:2px;">Change Orientation</span></a>
<a class="w3-bar-item w3-button ga-tryit" href="javascript:void(0);" title="Change Theme" onclick="openMenu();retheme()"><i class="fa fa-adjust" style="font-size:26px;margin-right:8px"></i><span style="position:relative;top:-4px;left:2px;">Change Theme, Dark/Light</span></a>
<a class="w3-bar-item w3-button ga-tryit" style="height: 62px;padding-top: 18px;" href="https://spaces.w3schools.com/" target="_blank" title="Go to Spaces"><img style="margin-left:9px;margin-right:15px;margin-bottom: 8px;" src="./W3Schools Tryit Editor_files/spaces-icon-tryit.svg" loading="lazy"><span style="position:relative;top:-4px;left:2px;">Go to Spaces</span></a>
</div>
<footer class="w3-container w3-small ws-grey">
<p>
<a style="display:inline;padding:0;" href="https://www.w3schools.com/about/about_privacy.asp" target="_blank" onclick="openMenu();" class="w3-hover-none ws-hover-text-green ga-tryit">Privacy policy</a> and
<a style="display:inline;padding:0;" href="https://www.w3schools.com/about/about_copyright.asp" target="_blank" onclick="openMenu();" class="w3-hover-none ws-hover-text-green ga-tryit">Copyright 1999-2025</a>
</p>
</footer>
</div>
<div id="menuOverlay" class="w3-overlay w3-transparent" style="cursor:pointer;z-index:4"></div>
<div id="textareacontainer">
<div id="textarea">
<div id="textareawrapper">
<textarea autocomplete="off" id="textareaCode" wrap="logical" spellcheck="false" style="display: none;"><!DOCTYPE html>
<html>
<body>
<?php
class Goodbye {
const LEAVING_MESSAGE = "Thank you for visiting W3Schools.com!";
public function byebye() {
echo self::LEAVING_MESSAGE;
}
}
$goodbye = new Goodbye();
$goodbye->byebye();
?>
</body>
</html>
</textarea><div class="CodeMirror cm-s-default CodeMirror-wrap CodeMirror-focused"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 141.319px; left: 164.774px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: -17px; border-right-width: 13px; min-height: 308px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors" style="visibility: hidden;"><div class="CodeMirror-cursor" style="left: 160.781px; top: 133.333px; height: 16.6667px;"> </div></div><div class="CodeMirror-code" style=""><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-m-xml cm-meta"><!DOCTYPE html></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-m-xml cm-tag cm-bracket"><</span><span class="cm-m-xml cm-tag">html</span><span class="cm-m-xml cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-m-xml cm-tag cm-bracket"><</span><span class="cm-m-xml cm-tag">body</span><span class="cm-m-xml cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-m-xml cm-meta"><?php</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-m-clike cm-keyword">class</span><span class="cm-m-clike"> </span><span class="cm-m-clike cm-def">bye</span><span class="cm-m-clike">{</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-m-clike cm-keyword">const</span><span class="cm-m-clike"> </span><span class="cm-m-clike cm-variable">message</span><span class="cm-m-clike cm-operator">=</span><span class="cm-m-clike cm-string">"this is the constraints "</span><span class="cm-m-clike">;</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-m-clike cm-keyword">public</span><span class="cm-m-clike"> </span><span class="cm-m-clike cm-keyword">function</span><span class="cm-m-clike"> </span><span class="cm-m-clike cm-def">byebye</span><span class="cm-m-clike">(){</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-m-clike cm-keyword">echo</span><span class="cm-m-clike"> </span><span class="cm-m-clike cm-keyword">self</span><span class="cm-m-clike">::</span><span class="cm-m-clike cm-variable">message</span><span class="cm-m-clike">;</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-m-clike">}</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-m-clike">}</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-m-clike cm-variable-2">$goodbye</span><span class="cm-m-clike"> </span><span class="cm-m-clike cm-operator">=</span><span class="cm-m-clike"> </span><span class="cm-m-clike cm-keyword">new</span><span class="cm-m-clike"> </span><span class="cm-m-clike cm-variable">Goodbye</span><span class="cm-m-clike">();</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-m-clike cm-variable-2">$goodbye</span><span class="cm-m-clike cm-operator">-></span><span class="cm-m-clike cm-variable">byebye</span><span class="cm-m-clike">();</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-m-clike cm-meta">?></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-m-xml cm-tag cm-bracket"></</span><span class="cm-m-xml cm-tag">body</span><span class="cm-m-xml cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-m-xml cm-tag cm-bracket"></</span><span class="cm-m-xml cm-tag">html</span><span class="cm-m-xml cm-tag cm-bracket">></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 308px;"></div><div class="CodeMirror-gutters" style="display: none; height: 321px;"></div></div></div>
<form id="codeForm" autocomplete="off" style="margin:0px;display:none;">
<input type="hidden" name="code" id="code">
</form>
</div>
</div>
</div>
<div id="iframecontainer">
<div id="iframe">
<div id="runloadercontainer"><div id="runloader"></div></div>
<div id="iframewrapper">
<div id="iframeResult" style="position:relative;white-space:nowrap;overflow:auto;">
<div>
Thank you for visiting W3Schools.com!
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function submitTryit(n) {
if (window.editor) {
window.editor.save();
}
var text = document.getElementById("textareaCode").value;
var ifr = document.createElement("iframe");
ifr.setAttribute("frameborder", "0");
ifr.setAttribute("id", "iframeResult");
ifr.setAttribute("name", "iframeResult");
document.getElementById("iframewrapper").innerHTML = "";
document.getElementById("iframewrapper").appendChild(ifr);
document.getElementById("iframeResult").addEventListener("load", hideSpinner);
displaySpinner();
var t=text;
t=t.replace(/=/gi,"w3equalsign");
t=t.replace(/\+/gi,"w3plussign");
var pos=t.search(/script/i)
while (pos>0) {
t=t.substring(0,pos) + "w3" + t.substr(pos,3) + "w3" + t.substr(pos+3,3) + "tag" + t.substr(pos+6);
pos=t.search(/script/i);
}
document.getElementById("code").value=t;
document.getElementById("codeForm").action = "https://try.w3schools.com/try_php.php?x=" + Math.random();
document.getElementById('codeForm').method = "post";
document.getElementById('codeForm').acceptCharset = "utf-8";
document.getElementById('codeForm').target = "iframeResult";
document.getElementById("codeForm").submit();
}
function hideSpinner() {
document.getElementById("runloadercontainer").style.display = "none";
}
function displaySpinner() {
var i, c, w, h, r, top;
i = document.getElementById("iframeResult");
w = w3_getStyleValue(i, "width");
h = w3_getStyleValue(i, "height");
c = document.getElementById("runloadercontainer");
c.style.width = w;
c.style.height = h;
c.style.display = "block";
w = Number(w.replace("px", "")) / 5;
r = document.getElementById("runloader");
r.style.width = w + "px";
r.style.height = w + "px";
h = w3_getStyleValue(r, "height");
h = Number(h.replace("px", "")) / 2;
top = w3_getStyleValue(c, "height");
top = Number(top.replace("px", "")) / 2;
top = top - h
r.style.top = top + "px";
}
var currentStack=true;
if ((window.screen.availWidth <= 768 && window.innerHeight > window.innerWidth) || "" == " horizontal") {restack(true);}
function restack(horizontal) {
var tc, ic, t, i, c, f, sv, sh, d, b, height, flt, width;
tc = document.getElementById("textareacontainer");
ic = document.getElementById("iframecontainer");
t = document.getElementById("textarea");
i = document.getElementById("iframe");
c = document.getElementById("container");
sv = document.getElementById("stackV");
sh = document.getElementById("stackH");
b = document.getElementsByClassName("localhostoutercontainer");
tc.className = tc.className.replace("horizontal", "");
ic.className = ic.className.replace("horizontal", "");
t.className = t.className.replace("horizontal", "");
i.className = i.className.replace("horizontal", "");
c.className = c.className.replace("horizontal", "");
if (b[0]) {b[0].className = b[0].className.replace("horizontal", "")};
if (sv) {sv.className = sv.className.replace("horizontal", "")};
if (sv) {sh.className = sh.className.replace("horizontal", "")};
stack = "";
if (horizontal) {
tc.className = tc.className + " horizontal";
ic.className = ic.className + " horizontal";
t.className = t.className + " horizontal";
i.className = i.className + " horizontal";
c.className = c.className + " horizontal";
if (sv) {sv.className = sv.className + " horizontal"};
if (sv) {sh.className = sh.className + " horizontal"};
if (b[0]) {b[0].className = b[0].className + " horizontal"};
stack = " horizontal";
document.getElementById("textareacontainer").style.height = "50%";
document.getElementById("iframecontainer").style.height = "50%";
document.getElementById("textareacontainer").style.width = "100%";
document.getElementById("iframecontainer").style.width = "100%";
currentStack=false;
} else {
document.getElementById("textareacontainer").style.height = "100%";
document.getElementById("iframecontainer").style.height = "100%";
document.getElementById("textareacontainer").style.width = "50%";
document.getElementById("iframecontainer").style.width = "50%";
currentStack=true;
}
fixDragBtn();
showFrameSize();
}
function showFrameSize() {
var t;
var width, height;
width = Number(w3_getStyleValue(document.getElementById("iframeResult"), "width").replace("px", "")).toFixed();
height = Number(w3_getStyleValue(document.getElementById("iframeResult"), "height").replace("px", "")).toFixed();
document.getElementById("framesize").innerHTML = "Result Size: <span>" + width + " x " + height + "</span>";
}
var dragging = false;
var stack;
function fixDragBtn() {
var textareawidth, leftpadding, dragleft, containertop, buttonwidth
var containertop = Number(w3_getStyleValue(document.getElementById("container"), "top").replace("px", ""));
if (stack != " horizontal") {
document.getElementById("dragbar").style.width = "5px";
textareasize = Number(w3_getStyleValue(document.getElementById("textareawrapper"), "width").replace("px", ""));
leftpadding = Number(w3_getStyleValue(document.getElementById("textarea"), "padding-left").replace("px", ""));
buttonwidth = Number(w3_getStyleValue(document.getElementById("dragbar"), "width").replace("px", ""));
textareaheight = w3_getStyleValue(document.getElementById("textareawrapper"), "height");
dragleft = textareasize + leftpadding + (leftpadding / 2) - (buttonwidth / 2);
document.getElementById("dragbar").style.top = containertop + "px";
document.getElementById("dragbar").style.left = dragleft + "px";
document.getElementById("dragbar").style.height = textareaheight;
document.getElementById("dragbar").style.cursor = "col-resize";
} else {
document.getElementById("dragbar").style.height = "5px";
if (window.getComputedStyle) {
textareawidth = window.getComputedStyle(document.getElementById("textareawrapper"),null).getPropertyValue("height");
textareaheight = window.getComputedStyle(document.getElementById("textareawrapper"),null).getPropertyValue("width");
leftpadding = window.getComputedStyle(document.getElementById("textarea"),null).getPropertyValue("padding-top");
buttonwidth = window.getComputedStyle(document.getElementById("dragbar"),null).getPropertyValue("height");
} else {
dragleft = document.getElementById("textareawrapper").currentStyle["width"];
}
textareawidth = Number(textareawidth.replace("px", ""));
leftpadding = Number(leftpadding .replace("px", ""));
buttonwidth = Number(buttonwidth .replace("px", ""));
dragleft = containertop + textareawidth + leftpadding + (leftpadding / 2);
document.getElementById("dragbar").style.top = dragleft + "px";
document.getElementById("dragbar").style.left = "5px";
document.getElementById("dragbar").style.width = textareaheight;
document.getElementById("dragbar").style.cursor = "row-resize";
}
}
function dragstart(e) {
e.preventDefault();
dragging = true;
var main = document.getElementById("iframecontainer");
}
function dragmove(e) {
if (dragging)
{
document.getElementById("shield").style.display = "block";
if (stack != " horizontal") {
var percentage = (e.pageX / window.innerWidth) * 100;
if (percentage > 5 && percentage < 98) {
var mainPercentage = 100-percentage;
document.getElementById("textareacontainer").style.width = percentage + "%";
document.getElementById("iframecontainer").style.width = mainPercentage + "%";
fixDragBtn();
}
} else {
var containertop = Number(w3_getStyleValue(document.getElementById("container"), "top").replace("px", ""));
var percentage = ((e.pageY - containertop + 20) / (window.innerHeight - containertop + 20)) * 100;
if (percentage > 5 && percentage < 98) {
var mainPercentage = 100-percentage;
document.getElementById("textareacontainer").style.height = percentage + "%";
document.getElementById("iframecontainer").style.height = mainPercentage + "%";
fixDragBtn();
}
}
showFrameSize();
}
}
function dragend() {
document.getElementById("shield").style.display = "none";
dragging = false;
var vend = navigator.vendor;
if (window.editor && vend.indexOf("Apple") == -1) {
window.editor.refresh();
}
}
if (window.addEventListener) {
document.getElementById("dragbar").addEventListener("mousedown", function(e) {dragstart(e);});
document.getElementById("dragbar").addEventListener("touchstart", function(e) {dragstart(e);});
window.addEventListener("mousemove", function(e) {dragmove(e);});
window.addEventListener("touchmove", function(e) {dragmove(e);});
window.addEventListener("mouseup", dragend);
window.addEventListener("touchend", dragend);
window.addEventListener("load", fixDragBtn);
window.addEventListener("load", showFrameSize);
}
function retheme() {
var cc = document.body.className;
if (cc.indexOf("darktheme") > -1) {
document.body.className = cc.replace("darktheme", "");
if (opener) {opener.document.body.className = cc.replace("darktheme", "");}
localStorage.setItem("preferredmode", "light");
} else {
document.body.className += " darktheme";
if (opener) {opener.document.body.className += " darktheme";}
localStorage.setItem("preferredmode", "dark");
}
}
(
function setThemeMode() {
var x = localStorage.getItem("preferredmode");
if (x == "dark") {
document.body.className += " darktheme";
}
})();
function colorcoding() {
var ua = navigator.userAgent;
//Opera Mini refreshes the page when trying to edit the textarea.
if (ua && ua.toUpperCase().indexOf("OPERA MINI") > -1) { return false; }
window.editor = CodeMirror.fromTextArea(document.getElementById("textareaCode"), {
mode: "application/x-httpd-php",
lineWrapping: true,
smartIndent: false,
htmlMode: true,
autocorrect: false,
addModeClass: true,
//mode: "application/x-httpd-php",
//lineWrapping: true,
//smartIndent: false
});
// window.editor.on("change", function () {window.editor.save();});
}
colorcoding();
function clickTab(x) {
return false;
}
function w3_getStyleValue(elmnt,style) {
if (window.getComputedStyle) {
return window.getComputedStyle(elmnt,null).getPropertyValue(style);
} else {
return elmnt.currentStyle[style];
}
}
function openMenu() {
var x = document.getElementById("navbarDropMenu");
var y = document.getElementById("menuOverlay");
var z = document.getElementById("menuButton");
if (z.className.indexOf("w3-text-gray") == -1) {
z.className += " w3-text-gray";
} else {
z.className = z.className.replace(" w3-text-gray", "");
}
if (z.className.indexOf("w3-gray") == -1) {
z.className += " w3-gray";
} else {
z.className = z.className.replace(" w3-gray", "");
}
if (x.className.indexOf("w3-show") == -1) {
x.className += " w3-show";
} else {
x.className = x.className.replace(" w3-show", "");
}
if (y.className.indexOf("w3-show") == -1) {
y.className += " w3-show";
} else {
y.className = y.className.replace(" w3-show", "");
}
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == document.getElementById("menuOverlay")) {
openMenu();
}
}
function setCodewindowHeight() {
var i;
var txw = document.getElementById("textareawrapper");
var txwh = w3_getStyleValue(txw,"height");
var qwsa = document.getElementsByClassName("codewindow");
for (i = 0; i < qwsa.length; i++) {
qwsa[i].style.height = txwh;
qwsa[i].style.setProperty("overflow", "auto", "important");
}
}
function docReady(fn) {
document.addEventListener("DOMContentLoaded", fn);
if (document.readyState === "interactive" || document.readyState === "complete" ) {
fn();
}
}
uic_prov_al();
</script>
<iframe name="__tcfapiLocator" style="display: none;" src="./W3Schools Tryit Editor_files/saved_resource(1).html"></iframe><iframe name="__uspapiLocator" style="display: none;" src="./W3Schools Tryit Editor_files/saved_resource(2).html"></iframe><iframe name="__adconsentLocator" style="display: none;" src="./W3Schools Tryit Editor_files/saved_resource(3).html"></iframe><iframe name="googlefcPresent" style="display: none; width: 0px; height: 0px; border: none; z-index: -1000; left: -1000px; top: -1000px;" src="./W3Schools Tryit Editor_files/saved_resource(4).html"></iframe><iframe name="googlefcInactive" src="./W3Schools Tryit Editor_files/saved_resource(5).html" style="display: none; width: 0px; height: 0px; border: none; z-index: -1000; left: -1000px; top: -1000px;"></iframe><iframe name="googlefcLoaded" src="./W3Schools Tryit Editor_files/saved_resource(6).html" style="display: none; width: 0px; height: 0px; border: none; z-index: -1000; left: -1000px; top: -1000px;"></iframe><iframe name="cnftComm" style="display: none; position: fixed; left: -999px; top: -999px; width: 0px; height: 0px;" src="./W3Schools Tryit Editor_files/saved_resource(7).html"></iframe><div id="confiant_tag_holder" style="display:none"></div><iframe src="./W3Schools Tryit Editor_files/syncframe.html" width="0" height="0" frameborder="0" sandbox="allow-scripts allow-same-origin" aria-hidden="true" title="Criteo GUM iframe" style="border-width: 0px; margin: 0px; display: none;"></iframe><iframe src="./W3Schools Tryit Editor_files/iu3.html" style="display: none;"></iframe><iframe src="./W3Schools Tryit Editor_files/aframe.html" width="0" height="0" style="display: none;"></iframe><iframe name="google_ads_top_frame" id="google_ads_top_frame" style="display: none; position: fixed; left: -999px; top: -999px; width: 0px; height: 0px;" src="./W3Schools Tryit Editor_files/saved_resource(8).html"></iframe></body><iframe name="goog_topics_frame" src="./W3Schools Tryit Editor_files/topics_frame.html" style="display: none;"></iframe><iframe sandbox="allow-scripts allow-same-origin" id="2303478cc069742" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" width="0" hspace="0" vspace="0" height="0" style="height:0px;width:0px;display:none;" scrolling="no" src="./W3Schools Tryit Editor_files/ixmatch.html">
</iframe><iframe sandbox="allow-scripts allow-same-origin" id="24cfcfab1bd5009" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" width="0" hspace="0" vspace="0" height="0" style="height:0px;width:0px;display:none;" scrolling="no" src="./W3Schools Tryit Editor_files/usync.html">
</iframe><iframe sandbox="allow-scripts allow-same-origin" id="250ae3258cd6c84" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" width="0" hspace="0" vspace="0" height="0" style="height:0px;width:0px;display:none;" scrolling="no" src="./W3Schools Tryit Editor_files/pb-sync.html">
</iframe><iframe sandbox="allow-scripts allow-same-origin" id="26d2852c2f53805" frameborder="0" allowtransparency="true" marginheight="0" marginwidth="0" width="0" hspace="0" vspace="0" height="0" style="height:0px;width:0px;display:none;" scrolling="no" src="./W3Schools Tryit Editor_files/async_usersync.html">
</iframe></html>