You've misdiagnosed the problem.
echo "<a data-toggle="
^ ^
^ end of PHP string
start of PHP string
You need to escape your "
characters as \"
when they are inside a string delimited by those characters.
Alternatively, use single quotes.
Alternatively, avoid stuffing HTML in PHP strings.
<?php
if ($section == "home" ){
?>
<a data-toggle="modal" data-target="#adminlogin" target="_blank">
Administration
<img src="img/cog.png">
</a>
<img src="">
<?php
}
?>