On 3 November 2010 21:42, Alexander Holodny alexander.holo...@gmail.com wrote:
To exclude unexcepted behavior in case of wrongly formated input data,
it would be much better to use such type-casting method:
intval(ltrim(trim($inStr), '0'))
2010/11/3, Nicholas Kell n...@monkeyknight.com:
On
On 4 November 2010 10:33, Richard Quadling rquadl...@gmail.com wrote:
?php
// Create test file.
$s_TabbedFilename = './test.tab';
file_put_contents($s_TabbedFilename, 0\t0002 . PHP_EOL .
4\t0004 . PHP_EOL);
// Open test file.
$fp_TabbedFile = fopen($s_TabbedFilename, 'rt') or
Hi,
The core of the code is simply
$fp = fopen('file.tab', 'rb');
while(!feof($fp))
{
$line = fgets($fp);
$data = explode(\t, $line);
...
}
So I try to manipulate the $data[X]. For example $data[0] is supposed to be
numeric so I $n = (int) $data[0]
One other thing if the second
On 4 November 2010 15:11, robert mena robert.m...@gmail.com wrote:
Hi,
The core of the code is simply
$fp = fopen('file.tab', 'rb');
while(!feof($fp))
{
$line = fgets($fp);
$data = explode(\t, $line);
...
}
So I try to manipulate the $data[X]. For example $data[0] is supposed
On 4 November 2010 15:31, robert mena robert.m...@gmail.com wrote:
Hi Richard,
I am not top posting. I am just explaining other symptoms that may point to
the cause since they may be the same and this is happening with the same
file. I'll try to get approval to release the file.
Meanwhile,
Hi,
I have a text file (utf-8 encoded) which contains lines with numbers and
text separated by \t. I need to convert the numbers that contains 0 (at
left) to integers.
For some reason one line that contains 0002 is casted to 0 instead of 2.
Bellow the output of the cast (int) $field[0]
To exclude unexcepted behavior in case of wrongly formated input data,
it would be much better to use such type-casting method:
intval(ltrim(trim($inStr), '0'))
2010/11/3, Nicholas Kell n...@monkeyknight.com:
On Nov 3, 2010, at 4:22 PM, robert mena wrote:
Hi,
I have a text file (utf-8
On Nov 3, 2010, at 4:22 PM, robert mena wrote:
Hi,
I have a text file (utf-8 encoded) which contains lines with numbers and
text separated by \t. I need to convert the numbers that contains 0 (at
left) to integers.
For some reason one line that contains 0002 is casted to 0 instead
8 matches
Mail list logo