<?php $str = '/текст/текст текст/нетекст/текст'; list($a, $b) = preg_split('/(?=\/[^\/]+$)/', $str); var_dump($a, $b);
Standard input is empty
string(48) "/текст/текст текст/нетекст" string(11) "/текст"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!