array to string conversion in alert in php code example

Example 1: php Array to string conversion

Using implode() function in Php
-----------------------
Syntax
implode(separator,array);  

Example
<?php  
//assigning value to the array  
$dummyArr = array("Hello","Greppers,","Ankur","here !");  
  
echo implode(" ",$dummyArr);// Use of implode function  
?>  
  
Output:
Hello Greppers, Ankur here !

Example 2: Notice: Array to string conversion php

// suppress the Notices:
error_reporting(0);
print(array(1,2,3));    //Prints 'Array' without a Notice.

Tags:

Php Example