wordpress.com – Help echo with the shortcode

i need help with this function, i have to show the strings $ md, $ dm, $ sd, $ ds

                                                                                // a dm - md
$ horarioDM = array (
Array (# a = => 04 04: 45,, & b = => # 06: 15 #),
Array (# a = => 05 05: 30,, & b = => 07 07: 15 #),
Array (# a = => 06 06: 30,, & b = => 08 08: 15 #),
Array (# a = => 07 07: 15,, & b = => 09 09: 15 #),
Array (# a = => 08 08: 15,, b b = => 10 10: 15 #),
Array (# a = => 09 09: 15,, & b => # 11: 15)),
Array (# a = => 09 09: 45,, & b => 12 12: 15 #),
Array (# a = => 10 10: 30,, & b => 13 13: 15 #),
Array (# a = => 11 11: 15,, b b = => 14 14: 15 #),
Array (# a = => 12 12: 00 #, & b => 15 15: 15)),
Array (# a = => 13 13: 15,, & b = => 16 16: 15 #),
Array (# a = => 13 13: 50,, & b => 16 16: 45 #),
Array (# a = => 14 14: 30,, & b => 17 17: 15 #),
Array (# a = => 15 15: 15,, & b => # 17: 45 #),
Array (# a = => 16 16:15,, & b = => 18 18: 15 #),
Array (# a = => 17 17: 15,, & b = => 19 19: 15 #),
Array (# a = => 18 18: 15,, & b => 20 20: 15 #),
Array (# a = => 19 19: 15,, & b = => 21 21: 00 #)
);
// a dm - sr
$ horarioSR = array (
Array (# a = => 06 06: 00 #, & b = => 07 07: 00 #),
Array (# a = => 09 09: 00 #, & b => 10 10: 00 #),
Array (# a = =>: 10: 00,, & b = => 11 11: 00 #),
Array (# a = => 11 11: 00,, & b = => 12 12: 00 #),
Array (# a = => 12 12: 00 #, & b => 13 13: 00 #),
Array (# a = => 13 13: 00 #, & b = => 14 14: 00 #),
Array (# a = => 16 16: 00 #, & b = => 17 17: 00 #)
);

$ ya = strtotime (date (Y Y-m-d H: i: s str, strtotime (now now #)));
$ fecha = strtotime (date (Y Y-m-d str, strtotime (now now #)));
$ diaDeLaSemana = date (& # 39; w & # 39 ;, strtotime (& # 39; now & # 39;));
$ i = $ diaDeLaSemana == 0? 1: 0;

$ md = & # 39; & # 39 ;;
/ * Echo data (# Y-m-d #, $ fecha). $ horarioDM[0]['b'], & # 39;
& # 39; date (& # 39; Y-m-d H: i & # 39 ;, $ ya); echo strtotime (date (& # 39; Y-m-d & # 39 ;, $ fecha). $ horarioDM[0]['b']). & # 39;
& # 39 ;. $ ya; Exit(); * / while (true) { $ dateFind = strtotime ((date (& # 39; Y-m-d & # 39 ;, $ fecha). $ horarioDM[$i]['b'])); if ($ dateFind> $ ya) { $ md = date (g: i a & # 39 ;, $ dateFind); break; }otherwise $ i ++; if ($ i> = count ($ horarioDM)) { $ fecha = strtotime (& # 39; + 1 day & # 39 ;, $ fecha); $ i = $ diaDeLaSemana == 0? 1: 0; } } $ fecha = strtotime (date (Y Y-m-d str, strtotime (now now #))); $ diaDeLaSemana = date (& # 39; w & # 39 ;, strtotime (& # 39; now & # 39;)); $ i = $ diaDeLaSemana == 0? 1: 0; $ dm = & # 39; & # 39 ;; while (true) { $ dateFind = strtotime ((date (& # 39; Y-m-d & # 39 ;, $ fecha). $ horarioDM[$i]['a'])); if ($ dateFind> $ ya) { $ dm = date (g: i a & # 39 ;, $ dateFind); break; }otherwise $ i ++; if ($ i> = count ($ horarioDM)) { $ fecha = strtotime (& # 39; + 1 day & # 39 ;, $ fecha); $ i = $ diaDeLaSemana == 0? 1: 0; } } // Santa pink $ fecha = strtotime (date (Y Y-m-d str, strtotime (now now #))); $ diaDeLaSemana = date (& # 39; w & # 39 ;, strtotime (& # 39; now & # 39;)); $ i = $ diaDeLaSemana == 0? 1: 0; $ sd = & # 39; & # 39 ;; while (true) { $ dateFind = strtotime ((date (& # 39; Y-m-d & # 39 ;, $ fecha). $ horarioSR[$i]['b'])); if ($ dateFind> $ ya) { $ sd = date (g: i a & # 39 ;, $ dateFind); break; }otherwise $ i ++; if ($ i> = count ($ horarioDM)) { $ fecha = strtotime (& # 39; + 1 day & # 39 ;, $ fecha); $ i = $ diaDeLaSemana == 0? 1: 0; } } $ fecha = strtotime (date (Y Y-m-d str, strtotime (now now #))); $ diaDeLaSemana = date (& # 39; w & # 39 ;, strtotime (& # 39; now & # 39;)); $ i = $ diaDeLaSemana == 0? 1: 0; $ ds = & # 39; & # 39 ;; while (true) { $ dateFind = strtotime ((date (& # 39; Y-m-d & # 39 ;, $ fecha). $ horarioSR[$i]['a'])); if ($ dateFind> $ ya) { $ ds = date (g: i a & # 39 ;, $ dateFind); break; }otherwise $ i ++; if ($ i> = count ($ horarioDM)) { $ fecha = strtotime (& # 39; + 1 day & # 39 ;, $ fecha); $ i = $ diaDeLaSemana == 0? 1: 0; } }

And that for the shortcode

add_shortcode (& # 39; md & # 39; & # 39; mdt & # 39;);
// add shortcode
Function dmt () {

echo $ dm;

}

Any idea?

PD: Sorry for my low english