Vreau să am separat numarul 123456 și punctele ... în doua variabile in php.
Am încercat să folosesc preg_replace ():
Cod: Selectaţi tot
$numbers = preg_replace('/[^0-9]/', '', '123456...');
$period = preg_replace('/./', '', '123456...);
Cod: Selectaţi tot
$numbers = preg_replace('/[^0-9]/', '', '123456...');
$period = preg_replace('/./', '', '123456...);
Cod: Selectaţi tot
$matches = null;
$input = '123456...';
preg_match('/(?<nums>\d+)(?<periods>\.+)/', $input, $matches);
$numbers = $matches['nums'];
$periods = $matches['periods'];
$nums_only = preg_replace('/[^\d]/', '', $input);