Support » Fixing WordPress » shortcode capture not working.

  • Hey,

    I am trying to populate an option dropdown based on an array generated from a shortcode. The shortcode is an official InfusionWP code. Currently the code looks like this:

    ob_start();
    //    echo '1234, 4321, 5678, 8765';
      echo '[i4w_db__HalifaxonlineAcNumber]';
      $accno = ob_get_contents();
    ob_end_clean();
    $clean = str_replace(" ", "", $accno);
    echo '$clean: ' . gettype($clean) . '= '.$clean.'<br />';
    $exploded = explode(",",$clean);
    echo '$exploded: ' . gettype($exploded) . '= ' .$exploded. '<br />';
    print_r($exploded);

    to wit it outputs:

    $clean: string= 123456, 654321, 852963
    $exploded: array= Array
    Array
    (
    [0] => 123456, 654321, 852963
    )

    As you will notice the output should return a 4 row array. If I set the output to the remmed out line and rem out the other line it outputs as expected.

    What is wrong with said array

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘shortcode capture not working.’ is closed to new replies.