2 years ago

#11081

test-img

alilot

Add variable output value and text in PHP

I am new to PHP. I need little help. It is related to Wordpress PHP. I have a Shortcode and a variable. I want to add the variable value inside the shortcode. Below is the code with explanation:

This is the code where I want to add variable output after "https://":

<?php echo do_shortcode('[qrgen4all data="https://' . $var . '"]');?>

This is the variable I want to add:

<?php $var = $this->Shipping_Address(); ?> 

where $var output is (it is a dynamic variable output):

"address
8422"

But the output is not adding after "https://" of the above shortcode.

Instead, If I set the variable value to $var = "google.com", then it works.

Why does the first dynamic variable "$var = $this->Shipping_Address()" value is not adding after "https://" in the shortcode?

php

wordpress

shortcode

0 Answers

Your Answer

Accepted video resources