简体   繁体   中英

Echo inside parameter of base_url()

I have this code below:

href="<?= base_url('classes/number_of_class')?>"

I'm thinking of something like this

href="<?= base_url('classes/$class['number']')?>"

I don't have any idea how to multi quote this or if it is even possible. Any other way how to do this is welcome.

Try this

<?= base_url("classes/{$class['number']}")?>

Or this

<?= base_url("classes/" . $class['number'])?>

尝试这个,

href="<?= base_url('classes/'.$class['number'])?>"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM