[英]Php get string after x characters
I have an array which returns me paths like these: 我有一个数组,它返回如下路径:
C:\xampp\htdocs\app\storage\app/img/img24.png"
C:\xampp\htdocs\app\storage\app/img/img3.png"
I need to extract the number from those parts, in this case 24 and 3 and save them into another array. 我需要从这些部分(在本例中为24和3)中提取数字并将其保存到另一个数组中。 So far I extracted the length like this: 到目前为止,我提取的长度是这样的:
$pathLen = strlen(storage_path('app/img/'));
That returned me 45, but I dont know how to continue 那让我回到了45岁,但我不知道如何继续
preg_match('~img/img(.*?).png~', $arrayinput, $output);
print_r($output[1]);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.