如果php中的Statement导致解析错误

I have to develop a code which meet certain logic

Here

count( $replies ) - calculate total replies on page

$replynumber - is what every reply which is 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 etc based on total number of replies done by users in the post

I am trying to dispaly custom advertising script based on adsense and other ad script depending on replies

    <?php 

    if( count( $replies ) <= 3 )
                    {   
                     <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- ad-->
<ins class="google"
     style="display:inline-block;width:200px;height:90px"
     data-ad-client="ca-pub-xxxxx"
     data-ad-slot="xxxx"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
                }

else if(((count( $replies ) > 3) and (count( $replies ) <= 6)) and ($replynumber == '1','3','5'))
                {           
                 <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- ad2-->
<ins class="google"
     style="display:inline-block;width:200px;height:90px"
     data-ad-client="ca-pub-xxxxx"
     data-ad-slot="xxxx"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
                }

else if(((count( $replies ) > 6) and (count( $replies ) <= 12)) and ($replynumber == '1','4','7','10'))
                {           
                 <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- ad3-->
<ins class="google"
     style="display:inline-block;width:200px;height:90px"
     data-ad-client="ca-pub-xxxxx"
     data-ad-slot="xxxx"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>               }               
               }
else if( count( $replies ) > 12 )
                {           
                 <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- ad4-->
<ins class="google"
     style="display:inline-block;width:200px;height:90px"
     data-ad-client="ca-pub-xxxxx"
     data-ad-slot="xxxx"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
                }                           
?>  

But this is leading to parse error Can any one help on it please

is because php can parse de script tag. You need to close de php like this ?> before the script and them open it again or print it with an echo for example: option 1:

if( count( $replies ) <= 3 )
{   
?>
 <script>       
 Script 1 to display
 </script>
<?php
}

option 2:

<?php 
if( count( $replies ) <= 3 )
   {   
    echo "  <script>       
    Script 1 to display
    </script>";
 }