php explode in

Posted on 2013-01-20
Last Modified: 2013-01-21
hello there,
I would like to know how can you write these 3 lines of code into

    $secret = explode(chr(3),$result);
    $secret = explode(chr(1),$secret[2]);
    $secret = $secret[0];

Open in new window

Question by:XK8ER
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 14

Expert Comment

ID: 38799661
Hey I'm not 100% if this would work, as I usually code in C#

but it could be a starting

Dim secreta() As String = Split(result, Chr(3))
secreta = Split(secreta(2), Chr(1))
secret = secret(0)

Open in new window


Accepted Solution

tap52384 earned 500 total points
ID: 38800142

explode(delimiter, string, [limit]);

$secret = explode(chr(3),$result);
$secret = explode(chr(1),$secret[2]);
$secret = $secret[0];

In VB:

Dim secret as String() = result.split(Chr(3))
secret = secret(2).split(Chr(1))

Open in new window

Don't see the need for the 3rd line.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question