How about iterating though the strings and putting string values and
lengths in an array:
[begin untested code]
$strings = array('i','am','who');
$string_count = array();
foreach ($strings as $string) {
$string_count['value'][] = $string;
$string_count['length'][] = strlen($string);
}
[begin untested code]
$name = 'John';
echo substr($fname,0,1);
[end untested code]
That will print the first letter of the variable $name.
substr(string,int start, int length);
int length is optional.
On Mon, 20 Dec 2004 19:59:49 +0200, Ahmed Abdel-Aliem [EMAIL PROTECTED] wrote:
hi
if i
I did something like this a while back, I believe I used chunk_split
[code]
?
$year_split = date(Y);
$chars = chunk_split($year_split,2);
print_r($chars);
?
[/code]
it'll output something along the lines of:
20
04
Hope this helps,
--
I can't wait for the replies...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I've googled the question and found no answer that has fixed my
problem. I also searched this list to try and find the answer to no
avail.
My problem is that after my form submits data to another script the
$_FILES global returns nothing but array() when I try to print_r()
it. I coppied the
How come you guys always go for the simplest answer? why not do something like,
$num = count($arrPt);
$arrPt[$num]['name'] = Figntin' Bob;
$arrPt[$num]['address'] = Under the Broad Street Bridge;
Live a little...
-Jasper
On Fri, 15 Oct 2004 09:07:43 -0500, Chris Boget [EMAIL PROTECTED] wrote:
/* Untested Code */
$arr[0]['id'] = 3;
$arr[0]['name] = 'Mike';
$arr[1]['id'] = 2;
$arr[1]['name'] = 'Bob';
$arr[2]['id'] = 5;
$arr[2]['name'] = 'Jane';
array_multisort($arr['id'],$arr['name']);
print It's .$arr[0]['name'].'s Turn To Take Out The Garbage!;
/* End Untested Code */
On Thu, 14
I believe that include() returns true|false, so $a would equal true if
the file is included and false if it is not.
On Thu, 14 Oct 2004 10:35:15 -0700 (PDT), Mag [EMAIL PROTECTED] wrote:
Hi,
I have never done this before (but in my first test it
seems to work), I am include()ing a file into a
Why use fpassthru? I just use readfile, is there a difference?
On Tue, 12 Oct 2004 11:11:54 -0500, Matt M. [EMAIL PROTECTED] wrote:
$filepath = bla/bla/files/;
$filename = file.zip;
$fullpath = $filepath/$filename;
header( ' Pragma: ');
header( ' Content-Type:
ok dudes, we understand, as much fun as I have downloading and reading
your awsome requests, lets just stop beating the horse, it's bee dead
for quite a while now...
On Tue, 12 Oct 2004 15:02:19 -0400, PHP Junkie [EMAIL PROTECTED] wrote:
I want an IDE that will let me speak code into it.
10 matches
Mail list logo