Title: Wrong string or array
Last modified: August 22, 2016

---

# Wrong string or array

 *  Resolved [fannyjukl](https://wordpress.org/support/users/fannyjukl/)
 * (@fannyjukl)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/wrong-string-or-array/)
 * Hi, I like that plugin, but in some cases it throws only “Array” instead of directors
   etc. I have tried to delete cache, db, folder, turn cache off, turn it on, nothing
   happend. When I looked in db the directors collum says “a:2:{i:0;s:13:”Pierre
   Coffin”;i:1;s:12:”Chris Renaud”;}”. Is it the problem, or am I doing something
   wrong? Thanks
 * EDIT: Sorry, I’m just stupid with wrong loop…
 * [https://wordpress.org/plugins/imdb-connector/](https://wordpress.org/plugins/imdb-connector/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [thaikolja](https://wordpress.org/support/users/thaikolja/)
 * (@thaikolja)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/wrong-string-or-array/#post-5800566)
 * The way IMDb Connector works is thisL: It sends an URL to omdapi.com with the
   tite or ID of the movie you like t have information about. Then it deoends on
   your plugin settigs: If you’ve hosen to save the results in the database, arrays
   are being converted into JSON format which looks like your example:
 *     ```
       "a:2:{i:0;s:13:"Pierre Coffin";i:1;s:12:"Chris Renaud";}". 
   
       Same goes for local caching. That's the only way to store arrays outside of PHP environment.
   
       "actors" is a popular example for an array. In the omdbapi.com response, the actors are seperated between commas as a string, that means you could run
   
       <blockquote><?php echo get_imdb_connector_movie_detail("Seven", "genre"); ?></blockquote>
   
       which would simplt return a sting:
   
       <code>Brad Pitt, Edward Norton, Samuel L. Jaksons</code>
   
       and mazbe some more actors. I found that quite unflexible so I transformed alll o these into an array. That means the result of the above example function would look like:
   
       array("Tom Cruise", "Samuel L. Jackson")
   
       This is a lot more flexible because this waz I can target specific actors *for example only the second). I can also use the sort() function to sort the actor by their name so on or use count() to count how manz actors are in this array. That's why I've decided to split them up into arrays.
   
       You can see more information here: <a href="http://www.koljanolte.com/wordpress/plugins/secondary-title/">http://www.koljanolte.com/wordpress/plugins/secondary-title/</a>
   
       Let's say you want to display the actors as a normal string seperated by commas, you can easily do this by using:
       ```
   
 * $movies = get_imdb_connector_movie(“Seven”);
    foreach($movies as $movie) { echo“"”.
   $movie[“title”] . ” was produced in the yearof ” . $movie[“uear”] . “.”; }`
 * But I’ve planned for the next version to include an option where ALL arras merge
   into a single string. Until then, you’d have to ue the method above.
 * I hope I could help a bit,
 * Kolja
 *  Thread Starter [fannyjukl](https://wordpress.org/support/users/fannyjukl/)
 * (@fannyjukl)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/wrong-string-or-array/#post-5800582)
 * You are **awesome**! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Wrong string or array’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/imdb-connector_bac675.svg)
 * [IMDb Connector](https://wordpress.org/plugins/imdb-connector/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/imdb-connector/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/imdb-connector/)
 * [Active Topics](https://wordpress.org/support/plugin/imdb-connector/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/imdb-connector/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/imdb-connector/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [fannyjukl](https://wordpress.org/support/users/fannyjukl/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/wrong-string-or-array/#post-5800582)
 * Status: resolved