M
M
Michael2016-11-29 17:01:30
PHP
Michael, 2016-11-29 17:01:30

How to parse a string into components?

Hello!
It is necessary to disassemble the drain of the view

mt4se-amuk-tradeterminal-4-p-59

and as a result get something like an array or a JSON object.
Is there any library (php, nodejs) besides parsing with regular expressions , anyone in the subject?
Many thanks!
PS
Sample result:
//mt4se-amuk-tradeterminal-4-p-59

Array (
    [mt4se-amuk-tradeterminal-4-p-59] => Array
        (
            ['namespace'] => 'main_uk',
            ['topic'] => 'TradeTerminal'
        )
)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Valentine, 2016-12-02
@Mikhail_RU

And why regular seasons do not suit?
https://regex101.com/r/RqnaRE/1

K
koida_yuri, 2016-11-29
@koida_yuri

Most likely you mean php.net/manual/en/function.parse-url.php

K
Konstantin Kitmanov, 2016-11-29
@k12th

https://nodejs.org/api/querystring.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question