Hi, I am using Snoopy (link) to grab some data. However, it returns the data in the form of an array of individual characters (i.e. $array = array("a", "b", "c")😉. Now this is rather unwieldy for the purpose of getting certain data out of the array.

I tried to implode the array ($newstr = implode("", $class->array)😉 but the variable $newstr is empty when I do this.

I really need to be able to convert this array into a string so I can extract the bits that I need out of it. Can anyone help me with this?

    Have you checked you really have something in $class->array, eg with

    echo "<pre>";
    print_r($class->array);
    echo "<pre>";
    

      Yes, I print the array every time, and also print the imploded array in parenthesis.

      Here is my code (edited the variables):

      <?php 
      
      
      include "Snoopy.class.php"; 
      
      $snoopy = new Snoopy; 
      
      $submit_url = "http://www.somesite.com/file.jsp"; 
      
      	$submit_vars["var1"] = "0001"; 
      	$submit_vars["var2"] = "2"; 
      
      $snoopy->submittext($submit_url,$submit_vars);
      
      $impresult = implode("", $snoopy->results);
      
      echo "<pre>";
      print_r($snoopy->results);
      echo "<pre>";
      
      echo "(";
      echo $impresult;
      echo ")";
      ?>
      

      Which results in:

      Text
      Text
      Text
      ()

        Write a Reply...