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 8329133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:40:18+00:00 2026-06-09T01:40:18+00:00

When running this PHP code: // test value $value = 123456-7890; // remove blank

  • 0

When running this PHP code:

// test value
$value = "123456-7890";

// remove blank spaces and explode
$value = str_replace(' ', '', $value);
$value = explode('-', $value);

// check number of digits depending on format
if ((count($value) == 1 && strlen($value[0]) != 10) || (strlen($value[0]) != 6 || strlen($value[1]) != 4))
{
    echo "wrong number of digits!";
}

I get the following error:

PHP Fatal error:  Call to undefined function  () in /Users/Rikard/Desktop/test.php on line 10

As far as I can tell the problem arises in this part: strlen($value[0]) != 10 but I cannot see why it appears, any thoughts?

  • 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-09T01:40:20+00:00Added an answer on June 9, 2026 at 1:40 am

    You see this:

    if ((count($value) == 1 && strlen($value[0]) != 10) || (strlen($value[0]) != 6 || strlen($value[1]) != 4))
    

    PHP sees this (• means non-breaking space):

    if ((count($value) == 1 && strlen($value[0]) != 10) ||•(strlen($value[0]) != 6 || strlen($value[1]) != 4))
    

    It always happens to me when I innocently try to copy some code from Mac/Safari. BTW, I tried to “edit” your question, and copied code from there for further examination.

    PHP interprets the non-breaking space as a valid function name, and tries to execute it:

    •(strlen($value[0])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP script with infinite loop. I need this script running forever.
I am running this code: #include <iostream> #include <cstddef> int main(int argc, char *argv[]){
- Running PHP 5.3.8 on Linux- To start, we have solved this issue to
Running Apache/PHP on this PC. I am using Eclipse >> Export Java > JAR
I'm getting this error when running this code: Fatal error: Uncaught exception 'DOMException' with
I'm having some hard time getting PHP APC to work. Here's my test code:
Running this program is printing forked! 7 times. Can someone explain how forked! is
Running this query takes a long time: SELECT host,ip FROM arecords WHERE ip IN
When running this XNA application it should display a rotated rectangle that moves from
After running this query statement with my database: select * from articles where content

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.