Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7090503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:03:46+00:00 2026-05-28T08:03:46+00:00

I m getting a request, when i use echo it prints it out on

  • 0

I m getting a request, when i use echo it prints it out on the shell and everything is awesome.

I want to write human readable string to file.

When i try to write these messages to file. i see binary string.

like this:

6^@8^@3^@7^@8^@1^@0^@,^@,^@1^@1^@b^@c^@d^@9^@0^@f^@-^@e^@3^@3^@a^@-^@4^@e^@0^@5^@-^@9^@e^@3^@d^@-^@5^@f^@a^@1^@8^@3^@4^@f^@d^@5^@e^@7^@,^@,^@:^@:^@1^@,^@M^@o^@z^@i^@l^@l^@a^@/^@5^@.^@0^@ ^@(^@W^@i^@n^@d^@o^@w^@s^@ ^@N^@T^@ ^@6^@.^@1^@;^@
 ^@W^@O^@W^@6^@4^@;^@ ^@r^@v^@:^@9^@.^@0^@.^@1^@)^@ ^@G^@e^@c^@k^@o^@/^@2^@0^@1^@0^@0^@1^@0^@1^@ ^@F^@i^@r^@e^@f^@o^@x^@/^@9^@.^@0^@.^@1^@,^@F^@i^@r^@e^@f^@o^@x^@,^@9^@.^@0^@,^@W^@i^@n^@d^@o^@w^@s^@,^@,^@0^@,^@0^@,^@0^@,^@0^@,^@0^@,^@,^@
 ^@:^@:^@1^@,^@ ^@1^@/^@2^@1^@/^@2^@0^@1^@2^@ ^@5^@:^@4^@5^@:^@5^@0^@ ^@P^@M^@

but i expect this:

6837817,,01497aed-181b-4054-b68f-3b41b4e707fc,,::1,Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,Firefox,9.0,Windows,,0,0,0,0,0,, ::1, 1/21/2012 5:45:51 PM

ok i saw that there are methods like pack and unpack to get string from binary string but i failed.

<?php

$context = new ZMQContext();
$receiver = new ZMQSocket($context, ZMQ::SOCKET_PULL);
$receiver->bind("tcp://*:5557");

$fp = fopen('data.txt', 'w');

while(true){ 
$str = $receiver->recv();

echo $str."\n";

file_put_contents('foo.txt', $str);

//fwrite($fp, $str."\n");


}
fclose($fp);
?>

How can i get this done? I just wanted to write the string to file:(

Also, is this an expensive operation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:03:47+00:00Added an answer on May 28, 2026 at 8:03 am

    What you have there isn’t binary data, but a different encoding for text. It’s some form of UCS-2 I’d say. So you can “decode” it with:

     $string = iconv("UCS-2LE", "UTF-8", $string);
     file_put_contents(...);
    

    See iconv and UCS-2, BOM FF FE.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make an http request (I use ksoap2) in the onCreate() during
We've been getting request (from worms?) of the form http://www.example.com/MSOffice/cltreq.asp?... http://www.example.com/_vti_bin/owssvr.dll?... What is the
I'm running IIS 7 Integrated mode and I'm getting Request is not available in
I keep getting a Request format is invalid. Here's the raw http that gets
i am getting this error failed to execute request because the app-domain could not
We are getting this error: System.ServiceModel.ServerTooBusyException: The request to create a reliable session has
I already tried getting the current URL of my UIWebView with: webview.request.URL . Unfortunately
I am having a hard time getting cxf to validate an xml request that
I'm getting the error Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Error executing child request for
Why am I getting these errors? alt text http://img39.imageshack.us/img39/2203/help.tif It says: Error: Request for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.