please correct me if i'm wrong,
[PHP]<? substr($line,0, 3) == Cpu ?>[/PHP]
is to read $line from 1st character to 3rd character, and compare it to string 'Cpu'
It works, thank you...
User Profile
Collapse
-
I'm sorry...
I have this line from a text file:
Code:Cpu(s):(B[m[39;49m(B[m 1.4%(B[m[39;49mus,(B[m[39;49m(B[m 1.6%(B[m[39;49msy,(B[m[39;49m(B[m 0.0%(B[m[39;49mni,(B[m[39;49m(B[m 96.3%(B[m[39;49mid,(B[m[39;49m(B[m 0.4%(B[m[39;49mwa,(B[m[39;49m(B[m 0.3%(B[m[39;49mhi,(B[m[39;49m(B[m 0.1%(B[m[39;49msi,(B[m[39;49m(B[m 0.0%(B[m[39;49mst(B[m[39;49m[K
Leave a comment:
-
Parsing a delimited text file into mysql database
Alrights....the delimited text in the topic is like this :
I would like to get the string with % in the line start with CPU(s) (shown Bold) and put them into a variables..
Would someone be kind enough to write a php file which will do that?
Because i know nothing about this parsing things, and just a very little knowledge about php. So the code would need to be complete i hope.....
No activity results to display
Show More
Leave a comment: