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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:49:09+00:00 2026-06-16T22:49:09+00:00

The problem is, I have an array that I get from this query :

  • 0

The problem is, I have an array that I get from this query :

$secimKrm   =   ("SELECT * FROM kurumlar
INNER JOIN veri_2012_09
ON kurumlar.krmKod  =  veri_2012_09.krmKod
WHERE kurumlar.krmKod = '$krmKod'");
$sonucKrm   =   $mysqliKrm->query($secimKrm);
$row    =   $sonucKrm->fetch_assoc();

“kurumlar” consists of strings
and “veri_2012_09” consists of big integers.
There are almost 35 columns in “veri_2012_09” and I don’t want to format numbers one by one.

When I try to format numbers in the array “$row” I use this:

foreach ($row as $key => $val) {
$row[$key] = number_format($val, 0, ',', '.');
}

It works, but it causes errors, (Warning: number_format() expects parameter 1 to be double, string given in…) because my array has strings in it. How can I exclude the strings before formatting the numbers?

  • 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-16T22:49:11+00:00Added an answer on June 16, 2026 at 10:49 pm

    Perform is_numeric check like:

    foreach ($row as $key => $val) {
        if (is_numeric($val)) {
            $row[$key] = number_format($val, 0, ',', '.');
        }
    }
    

    So your question shouldn’t be “How can I exclude the strings”, but “How can I include only strings”

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

Sidebar

Related Questions

I have a problem with an array that is getting returned from a query
I've been having a really weird problem. I have a mutable array that is
I have a pretty simple problem. Basically I have an array called $list that
I have a homework question that says: Problem 1: Given the array [ 22
I have problem i need to convert from my Array structure to std::vector<int> ...
Simplified version of the problem: So I have this query which is inside a
I have an array that's made up of data returned by a SQL query:
I have a small form that is generated from a mysqli->query and I've set
So I have this problem when I run a script with PHP PDO that
I have an array with all the results of a query search. My problem

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.