3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mediaArray ='Facebook,Twitter,Twitch,'; $otherMedia = 'House'; //convert string to array $socialArray = explode(',', $mediaArray); //declare some variables to be used later $andwhere = ''; $bp = ''; $socialmarray = ''; //get every value from array of social media foreach($socialArray as $socialmedia){ $socialmarray .=$socialmedia.','; $andwhere .= " AND socialmedianame=?"; $bp .='s'; } //test strings $wheres = $andwhere;//AND socialmedianame=? AND socialmedianame=? AND socialmedianame=? $bip = $bp.'s';//ssss $validarayy = rtrim($socialmarray,','); //Facebook,Twitter,Twitch $socialmarray2 = explode(',', $validarayy); var_dump($socialmarray2);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> string(8) "Facebook" [1]=> string(7) "Twitter" [2]=> string(6) "Twitch" }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
69.05 ms | 405 KiB | 5 Q