Note that there are some explanatory texts on larger screens.

plurals
  1. POCompressing PHP code
    primarykey
    data
    text
    <p>I have created a PHP script but while using it in my hosting server it show fatal error, then i have discovered that i need to compress this PHP code to make my script working.. Here is the code, any one can compress this code with the same output, i am a beginner in coding so can't understand how to act this same output with minimized code and efforts so that server can easily execute this code. Thanks The Code Need to be optimize:</p> <pre><code>$yar = 3; while ($yar &lt;= 9) { $ax = 31; while ($ax &gt; 0) { $jaan = "$ax Jan 200$yar"; $result = str_replace($jaan, " ", $result); $ax = $ax - 1; } $ax = 31; while ($ax &gt; 0) { $feeb = "$ax Feb 200$yar"; $result = str_replace($feeb, " ", $result); $ax = $ax - 1; } $ax = 31; while ($ax &gt; 0) { $maar = "$ax Mar 200$yar"; $result = str_replace($maar, " ", $result); $ax = $ax - 1; } $ax = 31; while ($ax &gt; 0) { $appr = "$ax Apr 200$yar"; $result = str_replace($appr, " ", $result); $ax = $ax - 1; } $ax = 31; while ($ax &gt; 0) { $maay = "$ax May 200$yar"; $result = str_replace($maay, " ", $result); $ax = $ax - 1; } $ax = 31; while ($ax &gt; 0) { $juun = "$ax Jun 200$yar"; $result = str_replace($juun, " ", $result); $ax = $ax - 1; } $ax = 31; while ($ax &gt; 0) { $juul = "$ax Jul 200$yar"; $result = str_replace($juul, " ", $result); $ax = $ax - 1; } $ax = 31; while ($ax &gt; 0) { $auug = "$ax Aug 200$yar"; $result = str_replace($auug, " ", $result); $ax = $ax - 1; } $ax = 31; while ($ax &gt; 0) { $seep = "$ax Sep 200$yar"; $result = str_replace($seep, " ", $result); $ax = $ax - 1; } $ax = 31; while ($ax &gt; 0) { $occt = "$ax Oct 200$yar"; $result = str_replace($occt, " ", $result); $ax = $ax - 1; } $ax = 31; while ($ax &gt; 0) { $noov = "$ax Nov 200$yar"; $result = str_replace($noov, " ", $result); $ax = $ax - 1; } $ax = 31; while ($ax &gt; 0) { $deec = "$ax Dec 200$yar"; $result = str_replace($deec, " ", $result); } $ax = $ax - 1; $yar++; } //years start after 2010 to 2014 $yr = 10; while ($yr &lt;= 14) { $x = 31; while ($x &gt; 0) { $jan = "$x Jan 20$yr"; $result = str_replace($jan, " ", $result); $x = $x - 1; } $x = 31; while ($x &gt; 0) { $feb = "$x Feb 20$yr"; $result = str_replace($feb, " ", $result); $x = $x - 1; } $x = 31; while ($x &gt; 0) { $mar = "$x Mar 20$yr"; $result = str_replace($mar, " ", $result); $x = $x - 1; } $x = 31; while ($x &gt; 0) { $apr = "$x Apr 20$yr"; $result = str_replace($apr, " ", $result); $x = $x - 1; } $x = 31; while ($x &gt; 0) { $may = "$x May 20$yr"; $result = str_replace($may, " ", $result); $x = $x - 1; } $x = 31; while ($x &gt; 0) { $jun = "$x Jun 20$yr"; $result = str_replace($jun, " ", $result); $x = $x - 1; } $x = 31; while ($x &gt; 0) { $jul = "$x Jul 20$yr"; $result = str_replace($jul, " ", $result); $x = $x - 1; } $x = 31; while ($x &gt; 0) { $aug = "$x Aug 20$yr"; $result = str_replace($aug, " ", $result); $x = $x - 1; } $x = 31; while ($x &gt; 0) { $sep = "$x Sep 20$yr"; $result = str_replace($sep, " ", $result); $x = $x - 1; } $x = 31; while ($x &gt; 0) { $oct = "$x Oct 20$yr"; $result = str_replace($oct, " ", $result); $x = $x - 1; } $x = 31; while ($x &gt; 0) { $nov = "$x Nov 20$yr"; $result = str_replace($nov, " ", $result); $x = $x - 1; } $x = 31; while ($x &gt; 0) { $dec = "$x Dec 20$yr"; $result = str_replace($dec, " ", $result); $x = $x - 1; } $yr++; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload