Reading text string from text file (PHP)
I have a text file where I can load the data well in an array, but now I have to change that on the same line. It is the following:
"printer name, ip address" ... And it must be captured and then print them in a the second file. How do I load the two strands of each variable in php?
Re: Reading text string from text file (PHP)
$ array = explode (";", $ string);
print_r ($ array)//show you array'et.
echo "Printer Name:". $ array [0]. "<br />\n";
echo "IP:". $ array [1]. "<br /> \ n";
Re: Reading text string from text file (PHP)
$text="printername,ipaddress";
list($ pnavn,$ipaddress)=explode (';',$ text);
Re: Reading text string from text file (PHP)
Thank you for your help :) There were several useful strings.