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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:41:25+00:00 2026-05-14T07:41:25+00:00

I have a invalid XML like this Warning: count() [function.count]: Node no longer exists

  • 0

I have a invalid XML like this

Warning: count() [function.count]: Node no longer exists in /var/bla/test.php
<?xml version="1.0" encoding="ISO-8859-1"?>
<nodes>
<some>test</some>
</nodes>

Now i need a regex which would replace the Warning: count() [function.count]: Node no longer exists in /var/bla/test.php with ""
how can i do that?

The above xml is is not generated on my localmachine, its a api call which returned a invalid xml

  • 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-14T07:41:26+00:00Added an answer on May 14, 2026 at 7:41 am

    Assuming you have to use a regular expression for some reason, this line of PHP removes everything from the start of the string until the first occurrence of <?xml:

    $output = preg_replace('/\A.*?<\?xml/s', '<?xml', $input);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an XML Schema that looks like this: <xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema> <xs:element name=root> <xs:complexType>
I have XML files containing data like this... <parent> <boy/> </parent> <parent> <girl/> <parent>
I have received some invalid XML data from a poll provider and would like
I have an XML that looks like this and a corresponding xsd with it.
I have an XML document with a basic structure like this: <?xml version=1.0 encoding=UTF-8
I have an XML document, and one of the nodes contains &isin; like this:
I have the following invalid XML file: <?xml version=1.0 encoding=utf-8 ?> <Page num=1 crop_box=0,
I am wondering about the performance of this index: I have an Invalid varchar(1)
I have been getting an invalid character! on what looks like the £ sign
I have some jQuery with an Ajax call that looks like this: $.ajax({ type:

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.