php引号无效

I am facing some problem in PHP code. It is a basic question but I don't know the answer. The code is here:

echo '<a href="profile.php?act=show&id=<?=$_SESSION['id']?>&line=true" class="myac">My Data</a>';

How to use the quotation mark in the id? Please help me.

That's wrong. Already you are using echo. So concatenate the value this way:

<?php
  echo '<a href="profile.php?act=show&id=' . $_SESSION['id'] . '&line=true" class="myac">My Data</a>';
  //-------------------------------------^^^^^^^^^^

And please refrain from using short tags (<? ?>), use full tags: <?php ?>.

apart from the above mentioned way by @praveen u can use it like below also if u don't want to put the anchor tag inside php

 <a href="profile.php?act=show&id=<?php echo $_SESSION['id']?>&line=true" class="myac">My Data</a>