english

learn php

learn css

learn html

learn javascript

learn php

3. types & strings

solution 3.1
2 minutes / 247 words

three / solution 3.1

<?php

$title = "Not Just a Bad President, Trump is a \"Holmesian Bad Man.\" Act Accordingly. (ACLU News and Commentary)";
$paragraph = "Donald Trump is a Holmesian bad man, and an even worse president, pushing the bounds of corruption and authoritarianism, unbound by norms, the rule of law, a sense of shame, or even care for others. To deal with such a bad man and bad president — one who truckles to adversaries like Russian President Vladimir Putin, flouts Congress, swims in self-enrichment, and fails to take meaningful action as Americans die by the tens of thousands on his watch — will require more than the ordinary processes, checks and balances, and honor that have guided and constrained other presidents.";

$title = str_replace(".", "!", $title);
$title = str_ireplace("and", "&", $title);
$title = str_replace("?", "?????", $title);
$title = str_replace("0", "", $title);
$title = str_replace("1", "", $title);
$title = str_replace("2", "", $title);
$title = str_replace("3", "", $title);
$title = str_replace("4", "", $title);
$title = str_replace("5", "", $title);
$title = str_replace("6", "", $title);
$title = str_replace("7", "", $title);
$title = str_replace("8", "", $title);
$title = str_replace("9", "", $title);
$title = trim($title);

$paragraph = str_replace(".", "!", $paragraph);
$paragraph = str_ireplace("and", "&", $paragraph);
$paragraph = str_replace("?", "?????", $paragraph);
$paragraph = str_replace("0", "", $paragraph);
$paragraph = str_replace("1", "", $paragraph);
$paragraph = str_replace("2", "", $paragraph);
$paragraph = str_replace("3", "", $paragraph);
$paragraph = str_replace("4", "", $paragraph);
$paragraph = str_replace("5", "", $paragraph);
$paragraph = str_replace("6", "", $paragraph);
$paragraph = str_replace("7", "", $paragraph);
$paragraph = str_replace("8", "", $paragraph);
$paragraph = str_replace("9", "", $paragraph);
$paragraph = trim($paragraph);

$title = mb_convert_case($title, MB_CASE_UPPER);

print_r($title . "\n\n" . $paragraph);

learn php

learn css

learn html

learn javascript

powered by akelei. an avi sato project.