Home > Backend Development > PHP Tutorial > 请问一个异常Warning: rawurlencode() expects parameter 1 to be string, array given

请问一个异常Warning: rawurlencode() expects parameter 1 to be string, array given

WBOY
Release: 2016-06-13 13:41:37
Original
1527 people have browsed it

请教一个错误Warning: rawurlencode() expects parameter 1 to be string, array given
Warning: rawurlencode() expects parameter 1 to be string, array given

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
$normalized = array();
    foreach($params as $key => $val)
    {
        $normalized[] = $key."=".rawurlencode($val);
    }

Copy after login


参数$params为
array
  'auto' => int 123
  'on' => string '256855' (length=13)
  'ei' => string '' (length=0)
  'tm' => string '59.00' (length=5)
  'name' => string '' (length=0)
  'add' => string '' (length=0)
  'state' => int 1
  'list' => 
  array
  1 => string 'xxxxddewweew拾掇拾掇/59.00/1@' (length=68)

------解决方案--------------------
rawurlencode() expects parameter 1 to be string, array given
rawurlencode() 需要一个字符串类型的参数,你却传递了一个数组
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template