Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the first number in a string?

Tags:

php

How can I remove the first number in a string? Say if I had these 48 numbers seperated with a ',' (comma):

8,5,8,10,15,20,27,25,60,31,25,39,25,31,26,28,80,28,27,31,27,29,26,35,8,5,8,10,15,20,27,25,60,31,25,39,25,31,26,28,80,28,27,31,27,29,26,35

How would I remove the "8," from the string? Thanks.

like image 718
Joey Morani Avatar asked Nov 28 '22 23:11

Joey Morani


1 Answers

substr(strchr("2512,12512,1245234,23452345", ","), 1)

actually. It the most efficient way I think because of it's not converting string into array or something. It;s just cut off string.

like image 184
Denis Bazhenov Avatar answered Dec 07 '22 22:12

Denis Bazhenov