$string = 'In My Car_Price : 50660.00';
echo intval(preg_replace('/[^0-9.]/','',$string)); # without number format output: 50660
echo number_format(intval(preg_replace('/[^0-9.]/','',$string))); # with number format output :50,660
string1 = "hello my name 12 is after 198765436281094and14 and 124de"
f= open("created_file.txt","w+")
for a in string1:
if a in ['1','2','3','4','5','6','7','8','9','0']:
f.write(a)
else:
f.write("\n" +a+ "\n")
f.close()
#desired_numbers=[x for x in open("created_file.txt")]
#print(desired_numbers)
k=open("created_file.txt","r")
desired_numbers=[]
for x in k:
l=x.rstrip()
print(len(l))
if len(l)==15:
desired_numbers.append(l)
#desired_numbers=[x for x in k if len(x)==16]
print(desired_numbers)