Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8637587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:30:51+00:00 2026-06-12T10:30:51+00:00

I came across this script at http://www.php.net/manual/en/function.str-split.php#78040 /** Returns a formatted string based on

  • 0

I came across this script at http://www.php.net/manual/en/function.str-split.php#78040

   /**
     Returns a formatted string based on camel case.
     e.g. "CamelCase" -> "Camel Case".
    */
    function FormatCamelCase( $string ) {
            $output = "";
            foreach( str_split( $string ) as $char ) {
                    strtoupper( $char ) == $char and $output and $output .= " ";
                    $output .= $char;
            }
            return $output;
    }

The curios Part Is :

strtoupper( $char ) == $char and $output and $output .= " ";

My Question

  • A detailed break down of strtoupper( $char ) == $char and $output and $output .= " "; and why its valid
  • This would not work for break , return , echo but it works for any function including print
  • Is this Best Practice
  • Do such code have any advantages or disadvantages
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:30:52+00:00Added an answer on June 12, 2026 at 10:30 am

    It is same as

    if (strtoupper( $char ) == $char) {
        if ($output) {
             $output .= " ";
        }  
    }
    

    For the code A and B, B will be executed if A is evaluated to true.

    The difference between && and and is && has higher precedence than and, .= is between them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently came across this line in a PHP script: $_REQUEST['start_date']=$date; Is it allowed
Came across this code: <?php require_once 'HTTP/Session/Container/DB.php'; $s = new HTTP_Session_Container_DB('mysql://user:password@localhost/db'); ini_get('session.auto_start') or session_start();
I came across a script that parses HTTP_ACCEPT_LANGUAGE: http://www.thefutureoftheweb.com/blog/use-accept-language-header this script returns an ORDERED
I came across this php script to pull IceCast stats (listeners,current song) from my
I recently came across this website: http://www.mccormackmorrison.com/ I love the navigation method (vertical /
I came across this shell script for OSX and I don't understand the following:
I came across this line in a MySQL script `other_validator` varchar(5000) NOT NULL DEFAULT
Please help me out, i came across this script in my project. Is this
I came across this syntax while reading a script. I am not sure what
I came across $$ expression in shell script, something like this TFILE=$$ Can anyone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.