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

  • Home
  • SEARCH
  • 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 267965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T23:37:43+00:00 2026-05-11T23:37:43+00:00

if (strlen($title) && strlen($message) > 3) This returns true if $title is over 3

  • 0
if (strlen($title) && strlen($message) > 3)

This returns true if $title is over 3 chars, I only want it to return true if BOTH is.
Whats the correct way? Tried a bunch. FNYS.

Help please.

  • 1 1 Answer
  • 1 View
  • 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-05-11T23:37:43+00:00Added an answer on May 11, 2026 at 11:37 pm

    if ((strlen($title) > 3) && (strlen($message) > 3))

    I do see what you’re shooting for, but it’s not often supported. In general, each chunk of the “if” test is self-standing — I like to add extra parentheses, just to make things clearer to scan.

    So your original test boiled down to “if(strlen($title))” and “if(strlen($message) > 3)”.

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

Sidebar

Related Questions

As the title says: Is there a difference between $str == '' and strlen($str)
In Guile 1.6.*, the function scm_istring2number(char *str,int strlen,int radix) does the work. However, this
<?php function VerifyForm(&$values, &$errors) { if (strlen($values['fname']) == 0) $errors['fname'] = 'Enter First Name';
What is the Perl equivalent of strlen() ?
The best that I have been able to come up with is: strlen(preg_replace('/^([\\*]*)\s(.+)/',$1,$line)); ^^That
I want to make a unique forum signature from my latest watched animes in
I have a large number of strings to process in php. I want to
I'm getting this strange behavior when fetching a website using socket. The string returned
Im not sure that it is the right way but I use this functions
Now, I'm just fooling around with this and I'm not sure as to why

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.