I was looking to take a string like Dan and return it like
D
A
N
is it the str function that does that
=
Dan McCullough
---
Theres no such thing as a problem unless the servers are on fire!
h: 603.444.9808
w: McCullough Family
Strings are arrays, so you can print out a string by doing something like
this:
$string = hey there!;
for ($i=0; $icount($string); $i++) {
echo strtoupper($string[$i]);
}
That's about all there is to it! :) Use the strtoupper() function if you
mean to have everything uppercase like in your
To be more precise add the br at the end of the line between the for loop:
Strings are arrays, so you can print out a string by doing something like
this:
$string = hey there!;
for ($i=0; $icount($string); $i++) {
echo strtoupper($string[$i]).'br';
}
That's about all there is to it! :) Use
Strings are arrays, so you can print out a string by doing something like
this:
Yups, this is possible, but i think he wants to have a newline for each
character,
you can doe this excelent with a small addition to your example:
$string = hey there!;
for ($i=0; $icount($string); $i++) {
$string = hey there!;
$out = '';
for ($i=0; $icount($string); $i++) {
$out .= strtoupper($string[$i]) . \n; // or br if output is to
browser
}
echo $out;
Richard Baskett [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Strings are arrays, so you can print
This only returns the first letter?
--- _lallous [EMAIL PROTECTED] wrote:
$string = hey there!;
$out = '';
for ($i=0; $icount($string); $i++) {
$out .= strtoupper($string[$i]) . \n; // or br if output is to
browser
}
echo $out;
Richard Baskett [EMAIL PROTECTED] wrote in message
Original message
From: Dan McCullough [EMAIL PROTECTED]
Date: Fri, Oct 26, 2001 at 06:03:00AM -0700
Message-ID: [EMAIL PROTECTED]
Subject: [PHP] String breaking up
I was looking to take a string like Dan and return it like
D
A
N
is it the str function that does that
=
Dan
7 matches
Mail list logo