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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:01:15+00:00 2026-05-23T12:01:15+00:00

I got an xml file : <?xml version=1.0 encoding=utf-8?> <pluginlist> <plugin> <pid>1</pid> <pluginname>ChatLogger</pluginname> <includepath>pugings/</includepath>

  • 0

I got an xml file :

<?xml version="1.0" encoding="utf-8"?>
<pluginlist>
    <plugin>
        <pid>1</pid>
        <pluginname>ChatLogger</pluginname>
        <includepath>pugings/</includepath>
        <cmds>say
        </cmds>
        <cmds>sayteam</cmds>

        <cmds>tell</cmds>

    </plugin>
</pluginlist>

And a php was something like this :

<?php 
        $xml_pluginfile="pluginlist.xml";
        if(!$xml=simplexml_load_file($xml_pluginfile)){
            trigger_error('Error reading XML file',E_USER_ERROR);
        }
        foreach($xml as $plugin){
            echo $plugin->pid." : ";
            foreach($plugin->cmds as $value)
            {
                echo $value." ". strlen(value)."<br />";
            }
            echo "<br />";
        }
?>

The output i get is :

1 : say 5
sayteam 5
tell 5

Why do i get the length of each output as 5 ?

and when i try to do this :

if($value)=="say"

Why is this happening ?

Please help me
thanks

  • 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-05-23T12:01:16+00:00Added an answer on May 23, 2026 at 12:01 pm

    It’s because there it whitespace in one of the <cmds> tags. You can fix this by removing the whitespace or by using the following to your PHP code:

    foreach($plugin->cmds as $value)
    {
        $value = trim($value); // removes whitespace from the start or end of
                               // the string
        // ...
    }
    

    Also: strlen(value) should also be changed to strlen($value).

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

Sidebar

Related Questions

I have got below xml format file called ResourceData.xml . <?xml version=1.0 encoding=utf-8 ?>
I've got the following xml file: <?xml version=1.0 encoding=utf-8?> <Project ToolsVersion=4.0 DefaultTargets=DeployPrototype xmlns=http://schemas.microsoft.com/developer/msbuild/2003> <PropertyGroup>
I've got the following xml file: <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/linearLayout1 android:background=@android:color/transparent android:layout_marginTop=0px
assuming I got following XML file : <?xml version=1.0 encoding=ISO-8859-1 ?> <MyCarShop> <Car gender=Boy>
I've got the following JNLP: <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE jnlp PUBLIC -//Sun Microsystems, Inc//DTD
I've got XML feed from public google calendar. Looks like this: <?xml version='1.0' encoding='UTF-8'?>
if i parse this xml file: <?xml version=1.0 encoding=UTF-8?> <rootnode> <testnode info=Test1/> <testnode info=Test2/>
I've got my AdMob code implemented into my XML file like this: <?xml version=1.0
I've got an XML file that contains a list of questions. I'd like to
I've got an XML file on my server, and my partners have to access

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.