0

I'm just messing around with PHP again and I need some help.

I'm working on a project where I type a Magic: The Gathering card in and it goes to the URL for that card and saves the picture to my Pictures folder.

I use ucwords to capitalize the words when I save them to a file. However, I want to make sure certain words are lower case (the, and, of, etc.). How can I do that?

Thanks.

Here's my results.php code:

<?php

$results = $_POST['cardname'];
$query_array = array('name'=>$_POST['cardname'], 'type'=> 'card', '.jpg');
$url = "http://gatherer.wizards.com/Handlers/Image.ashx?".http_build_query($query_array);
$img = "Pictures/" . ucwords($results) . ".png";
file_put_contents($img, file_get_contents($url));
?>

<img src="<?php echo $url ?>">
<br><br><br><br>
<form action="cardfetch.php">
  <input type="submit" value="Back">
</form>
Thomas Hutton
  • 793
  • 5
  • 15
  • 34

0 Answers0