在HTML标记中放置包含引号的php代码时出现语法错误

Getting syntax errors when trying to replace hard coded url value below

<a class="cta cta-blue" href="http://example.com/book-now.html">Book your free consultation</a>

with URL that is generated dynamically through PHP code

<?php echo token_replace("[site:jc-book-now-url]"); ?>

Unfortunately, below does not work due to a mixup with quotation marks

<a class="cta cta-blue" href="<?php echo token_replace("[site:jc-book-now-url]"); ?>">Book your free consultation</a>

I'm assuming you're having issues with
<a class="cta cta-blue" href="<?php echo token_replace("[site:jc-book-now-url]"); ?>">Book your free consultation</a>

There are different ways of doing this but my preferred method is:

Use single quotes
<a class="cta cta-blue" href="<?php echo token_replace('[site:jc-book-now-url]'); ?>">Book your free consultation</a>
or
<a class="cta cta-blue" href='<?php echo token_replace("[site:jc-book-now-url]"); ?>'>Book your free consultation</a>

Ultimately, this is up to you! Any one of the aforementioned options will work...