Jump to content

cannot use [] on string?!


map200uk

Recommended Posts

hi,

 

im having problems with part of my code-which did previously work

 

function addtoPlaylist()
{

$play=array();
$play=$_GET['path'];


//echo $_GET['path'];
$_SESSION['song'][]=$play;
}

anyone have any ideas how to fix? thanks!

Fatal error: [] operator not supported for strings in /opt/lampp/htdocs/beta/phpdb/playlist.php on line 32

 

 

Link to comment
https://forums.phpfreaks.com/topic/53070-cannot-use-on-string/
Share on other sites

array(1) { [0]=>  string(51) "http://148.197.34.121/mp3/07-maroon_5-cant_stop.ogg" }

 

 

so it adds it there, but each time it gets overwritten with the next selection, i did have it working right (not quie sure what o changed)

 

so it adds each path as the next element in the song array

 

 

Link to comment
https://forums.phpfreaks.com/topic/53070-cannot-use-on-string/#findComment-262186
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.