Reputation: 1170
I want to split part of this user-entered URL on the slashes (//). Everything I try just returns false or an empty string. How can I do it?
mb_internal_encoding("UTF-8");
$url = urldecode('aaa%BAbbb//ccc%D0ddd');
echo 'url: ' . $url . "\n";
$test = mb_split('//', $url);
$test2 = explode("//", $url);
$test3 = mb_ereg("//", $url);
echo "test: " . json_encode($test) . "\n-----------\n";
echo "test2: " . json_encode($test2) . "\n------------\n";
echo "test3: " . json_encode($test3) . "\n------------\n";
thanks
Upvotes: 1
Views: 60
Reputation: 1170
explode()
works and json_encode wasn't working to output the results. var_dump and print_r work to output the results.
Upvotes: 1