$file_array=preg_replace('/\<(\d+)\>/','<img src="$1.jpg" />', $file_array);
How to make the numbers be without the first 0? in the text <080> can be met, how instead of $ 1 = 080 get $ 1 = 80 ? if there is such a way)
', $file_array); How to make the numbers be without the first 0? in the...">
$file_array=preg_replace('/\<(\d+)\>/','<img src="$1.jpg" />', $file_array);
How to make the numbers be without the first 0? in the text <080> can be met, how instead of $ 1 = 080 get $ 1 = 80 ? if there is such a way)
try rewriting it somewhere
/\<0*(\d+)\>/','<img src="$1.jpg" />
And turn on the greedy mode, if it is not included. The construction 0 * just captures leading zeros.
Source: https://ru.stackoverflow.com/questions/51492/
All Articles