How to insert values of array in different block text.
-
//Sorry for my English.
I have a function which returns an array:function isset_municipio_vars(){ if(isset($_SESSION['municipio_vars'])){ $municipio_vars = $_SESSION['municipio_vars'];//This is an array with values:name,address,phone,etc.. }else{ echo "MUNICIPIO_VARS no existe"; } return $municipio_vars; } add_shortcode('isset_municipio_vars', 'isset_municipio_vars');
What can I do to use it in different block text?
Three different block text:Name: [isset_municipio_vars $municipio_vars->NAME] Adress: [isset_municipio_vars $municipio_vars->ADRESS] Phone: [isset_municipio_vars $municipio_vars->PHONE] ...
I known that this is wrong but it is the idea.
I just got this:
function isset_municipio_vars(){ if(isset($_SESSION['municipio_vars'])){ $municipio_vars = $_SESSION['municipio_vars'];//This is an array with values:name,address,phone,etc.. }else{ echo "MUNICIPIO_VARS no existe"; } return $municipio_vars->NAME; } add_shortcode('isset_municipio_vars', 'isset_municipio_vars');
One only value:
Name: [isset_municipio_vars]
//This return the nameThanks for your attention,
Regards
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to insert values of array in different block text.’ is closed to new replies.