A
A
Alexander Mylchenko2016-06-09 19:38:41
PHP
Alexander Mylchenko, 2016-06-09 19:38:41

How to translate bitwise shift operation from C++ to Php?

Friends,
good afternoon.
In C++ there is such an expression ;

x = "abc def" ;
x >> a >> b ;
// в результате
а == "abc" ;
b == "def" ;

Please, tell me how to describe this operation in php?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
AtomKrieg, 2016-06-09
@ERrorMAKros

This is not a bitwise operation. This is an overloaded stream operator:
www.cplusplus.com/reference/istream/istream/operat...
In php use php.net/manual/en/function.explode.php

D
dev400, 2016-06-09
@dev400

<?php
$x = "abc def" ;
$array = explode(" ", $x);
var_dump($array);
/*
    array(2) {
         [0]=> string(3) "abc"
         [1]=> string(3) "def" 
    }
*/

A
Alexander Aksentiev, 2016-06-09
@Sanasol

https://secure.php.net/manual/en/language.operator...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question