Title: shortcode capture not working.
Last modified: August 20, 2016

---

# shortcode capture not working.

 *  [Joshua](https://wordpress.org/support/users/s001911/)
 * (@s001911)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/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)

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/shortcode-capture-not-working/#post-2376506)
 * First guess – the string is in a different character set than the code. Neither
   the str_replace or the explode matched.
 * See the PHP manual, especially these functions:
 * [http://www.php.net/manual/en/function.utf8-decode.php](http://www.php.net/manual/en/function.utf8-decode.php)
 * [http://php.net/manual/en/function.mb-detect-encoding.php](http://php.net/manual/en/function.mb-detect-encoding.php)

Viewing 1 replies (of 1 total)

The topic ‘shortcode capture not working.’ is closed to new replies.

## Tags

 * [array](https://wordpress.org/support/topic-tag/array/)
 * [object](https://wordpress.org/support/topic-tag/object/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/shortcode-capture-not-working/#post-2376506)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
