Array

Array

am 29.09.2006 17:21:17 von Ron Piggott

--=-26teVOjfItNh9jYWhODj
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

If I have the sentences

Check one two three four. You did well to count to four.

how do I put each word into an array (so there would be 12 components in
the array) as well as remove the period and make the C in Check and the
Y in You lower case

Ron



--=-26teVOjfItNh9jYWhODj--

Re: Array

am 29.09.2006 17:38:16 von Niel Archer

Hi Ron,

> how do I put each word into an array (so there would be 12 components in
> the array) as well as remove the period and make the C in Check and the
> Y in You lower case

This isn't a DB question, please ask questions in the appropriate list.

But for reference, look up the str_replace, strtolower, and explode
functions.

Niel

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: Array

am 29.09.2006 18:27:03 von Shaun A Riches

--MIRAPOINT_PART1_451d4958
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C6E3E4.18F76546"

------_=_NextPart_001_01C6E3E4.18F76546
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

This is hardly database related but nonetheless.

$myString =3D "Check one two three four. You did well to count to =
four.";
$myString =3D str_replace(".","",$myString);
$myString =3D strtolower($myString);

$myWords =3D explode(" ", $myString);

// do stuff here with your array
?>

How is that?

___________________
Shaun Riches
Computer Science Student
http://www.sh4un.co.uk



-----Original Message-----
From: Ron Piggott (PHP) [mailto:ron.php@actsministries.org]
Sent: Fri 29/09/2006 16:21
To: PHP DB
Subject: [PHP-DB] Array
=20
If I have the sentences

Check one two three four. You did well to count to four.

how do I put each word into an array (so there would be 12 components in
the array) as well as remove the period and make the C in Check and the
Y in You lower case

Ron




------_=_NextPart_001_01C6E3E4.18F76546
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable




charset=3Diso-8859-1">
6.5.7650.28">
RE: [PHP-DB] Array




This is hardly database related but nonetheless.



<?

$myString =3D "Check one two three four.  You did well to =
count to four.";

$myString =3D str_replace(".","",$myString);

$myString =3D strtolower($myString);



$myWords =3D explode(" ", $myString);



// do stuff here with your array

?>



How is that?



___________________

Shaun Riches

Computer Science Student









-----Original Message-----

From: Ron Piggott (PHP) [ HREF=3D"mailto:ron.php@actsministries.org">mailto:ron.php@ac tsministries.=
org
]

Sent: Fri 29/09/2006 16:21

To: PHP DB

Subject: [PHP-DB] Array



If I have the sentences



Check one two three four.  You did well to count to four.



how do I put each word into an array (so there would be 12 components =
in

the array) as well as remove the period and make the C in Check and =
the

Y in You lower case



Ron












------_=_NextPart_001_01C6E3E4.18F76546--


************************************************************ *****************************
To view the terms under which this email is distributed, please go to http://www.hull.ac.uk/legal/email_disclaimer.html
************************************************************ *****************************

--MIRAPOINT_PART1_451d4958
Content-Type: text/plain; charset=us-ascii

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--MIRAPOINT_PART1_451d4958--