Jump to content

Need help in php output.


ShivaGupta

Recommended Posts

i am new in php n dont have enough since to solve some provlemes  myself.i am working with php using some examples and littile 

Knowledge

but its imported for me .so plz help me .sorry for bed english.

 

 

i have this ocr class

<?php
$client = new SoapClient("http://www.ocrwebservice.com/services/OCRWebService.asmx?WSDL"
, array("trace"=>1, "exceptions"=>1)

);

$params = new StdClass();
$params->user_name = "example";
$params->license_code = "xxxxx-xxxxx-xxxxx-cccccc";
    		 

$inimage = new StdClass();


$image  = "xxxxx.png";
$handle = fopen("$image", 'r');
$card_image = fread($handle, filesize($image));
fclose($handle);

$inimage->fileName = $image;
$inimage->fileData = $card_image;

$params->OCRWSInputImage = $inimage;

$settings = new StdClass();
$settings->ocrLanguages = array("ENGLISH");
$settings->outputDocumentFormat  = "TXT";
$settings->convertToBW = TRUE;
$settings->getOCRText = TRUE;
$settings->createOutputDocument = FALSE;
$settings->multiPageDoc = FALSE;
$settings->ocrWords = FALSE;

$params->OCRWSSetting = $settings;

try 
{
$result = $client->OCRWebServiceRecognize($params);
} 
catch (SoapFault $fault) 
{
print($client->__getLastRequest());
print($client->__getLastRequestHeaders());
}
var_dump($result);
print("Done");
?>

and here is their output

 

 

 

 

 

 

 

object(stdClass)#5 (1) { ["OCRWSResponse"]=> object(stdClass)#6 (2) { ["ocrText"]=> object(stdClass)#7 (1) { ["ArrayOfString"]=> object(stdClass)#8 (1) { ["string"]=> string(9) "VR eP gT " } } ["ocrWSWords"]=> object(stdClass)#9 (0) { } } } Done

 

 

 

 

 

 

 

 

i dont understand how to get  string data   "VR eP gT "     frm output and save as text file.so plz give me a hint or a example.

Link to comment
https://forums.phpfreaks.com/topic/280012-need-help-in-php-output/
Share on other sites

  On 7/10/2013 at 6:45 AM, cpd said:
$result->OCRWSResponse->ocrText->ArrayOfString->string

i reealy dont understand where edit .have error if edit  like this

Catchable fatal error: Object of class stdClass could not be converted to string in /home/content/65/11169265/html/8/index.php on line 47

help me plz

  On 7/10/2013 at 4:01 AM, avshelestov said:

Hello.

$result->string ???

i try with this hint my level but  not susses .need more help for get that content n save as text.

Beginner with beginner question  so

better if anyoned reply with edited code.

 

 

 

regards

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.