Jump to content

capitalizing words w/ php help


mikefrederick

Recommended Posts

i agree with PHP Monkeh, change your code to...

 

$ee=strtolower($x);

$dd= ucwords($ee);

 

echo "$ee is ".$ee."<b r>";

echo "$dd is ".$dd."<b r>"; //(those are breaks btw)

 

//  $qr="insert into citiez (cname,sid) values ('$cname','$dd')";

//  mysql_query($qr)

//    or die("Query failed: <br>".mysql_error();

 

That should work for you to debug it :)

<?php

$x = "potAtoEs";
$ee = strtolower($x);
$dd = ucwords($ee);

echo '$x is defined to ' . $x . '<br>';
echo '$ee is defined to ' . $ee . '<br>';
echo '$dd is defined to ' . $dd;
?>

 

$x is defined to potAtoEs
$ee is defined to potatoes
$dd is defined to Potatoes

 

Dorac your's will not work.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.