Hi,

What's the code to print out all letters that is consonants (exclude all vowels)?

$name = James Cool Yang;

    i=1;
    do 
	 	{
 		echo parse_str($name) 
 		}
while(i<strlen($name))

The following error occurs:

Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\php_exercise\exercise4.php on line 4

Try to change i to $i And wrap $name value around quotes: $name = "James Cool Yang"; The easiest way to remove vowels is to use str_replace() check example #1 here: http://php.net/manual/en/function.str-replace.php
bye :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.