Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#PHP, 92 bytes

PHP, 92 bytes

First attempt at code golf.

foreach(explode(" ",str_replace(["AND","OR","BY","OF"],"",strtoupper($s)))as$x){echo$x[0];}

The variable $s is the phrase to be converted: $s = "United States of America".

Requires PHP 5.4 or above for short array syntax to work.

#PHP, 92 bytes

First attempt at code golf.

foreach(explode(" ",str_replace(["AND","OR","BY","OF"],"",strtoupper($s)))as$x){echo$x[0];}

The variable $s is the phrase to be converted: $s = "United States of America".

Requires PHP 5.4 or above for short array syntax to work.

PHP, 92 bytes

First attempt at code golf.

foreach(explode(" ",str_replace(["AND","OR","BY","OF"],"",strtoupper($s)))as$x){echo$x[0];}

The variable $s is the phrase to be converted: $s = "United States of America".

Requires PHP 5.4 or above for short array syntax to work.

deleted 5 characters in body
Source Link
cat
  • 6.1k
  • 2
  • 27
  • 45

PHP, 92 characters

#PHP, 92 bytes

First attempt at code golf.

foreach(explode(" ",str_replace(["AND","OR","BY","OF"],"",strtoupper($s)))as$x){echo$x[0];}

The variable $s is the phrase to be converted: $s = "United States of America".

Requires PHP 5.4 or above for short array syntax to work.

PHP, 92 characters

First attempt at code golf.

foreach(explode(" ",str_replace(["AND","OR","BY","OF"],"",strtoupper($s)))as$x){echo$x[0];}

The variable $s is the phrase to be converted: $s = "United States of America".

Requires PHP 5.4 or above for short array syntax to work.

#PHP, 92 bytes

First attempt at code golf.

foreach(explode(" ",str_replace(["AND","OR","BY","OF"],"",strtoupper($s)))as$x){echo$x[0];}

The variable $s is the phrase to be converted: $s = "United States of America".

Requires PHP 5.4 or above for short array syntax to work.

Added instructions on how to use and minimum PHP version supported
Source Link
Justin
  • 139
  • 2

PHP, 92 characters

First attempt at code golf.

foreach(explode(" ",str_replace(["AND","OR","BY","OF"],"",strtoupper($s)))as$x){echo$x[0];}

The variable $s is the phrase to be converted: $s = "United States of America".

Requires PHP 5.4 or above for short array syntax to work.

PHP, 92 characters

First attempt at code golf.

foreach(explode(" ",str_replace(["AND","OR","BY","OF"],"",strtoupper($s)))as$x){echo$x[0];}

PHP, 92 characters

First attempt at code golf.

foreach(explode(" ",str_replace(["AND","OR","BY","OF"],"",strtoupper($s)))as$x){echo$x[0];}

The variable $s is the phrase to be converted: $s = "United States of America".

Requires PHP 5.4 or above for short array syntax to work.

Source Link
Justin
  • 139
  • 2
Loading

AltStyle によって変換されたページ (->オリジナル) /