Php replacement problems

Source: Internet
Author: User
Php replacement problem for ($ I = 0; $ I <20; $ I ++ ){
If ($ rs-> Fields ($ I)-> value = ''){
$ Arr [$ I] = "''";
} Else {
$ Arr [$ I] = $ rs-> Fields ($ I)-> value;
If ($ arr [$ I] = 'telephony '){
$ Arr [$ I] = 5;
}


}
}
Why cannot I replace the phone number?


Reply to discussion (solution)

It may be about character sets.

Do not map, var_dump ($ rs-> Fields); paste this result

Try double quotation marks...

It may be about character sets.
I read it from the access database.

Try double quotation marks...
Still not good

Do not map, var_dump ($ rs-> Fields); paste this result
The result is variant Object.

Character set problems may occur no matter where it comes from.
Var_dump ($ arr );
Post result



It may be about character sets.
I read it from the access database.

Character set problems may occur no matter where it comes from.
Var_dump ($ arr );
Post result




It may be about character sets.
I read it from the access database.

Var_dump indicates that the memory cannot be read.

Try
$ Arr [$ I] = $ rs-> Fields ($ I)-> value;
Change
$ Arr [$ I] = strval ($ rs-> Fields ($ I)-> value );

Try
$ Arr [$ I] = $ rs-> Fields ($ I)-> value;
Change
$ Arr [$ I] = strval ($ rs-> Fields ($ I)-> value );
The same
Array ([0] => 502 [1] => 10121001 [2] => schedule a check in mid-December. Return visit: shutdown [3] => male [4] => 50 [5] => 13610956510 [6] => 0 [7] => sexual dysfunction [8] => Check [9] => Li Wei [10] => 0 [11] => 2010-12-15 [12] => 2010-10-14 [13] => 10-14 [14] => 0 [15] => 0 [16] => 23:36:01 [17] => 1 [18] => Consulting [19] => phone number)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.