3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function ordArray($email) { $partes = str_split(trim($email)); $nuevo = ''; foreach ($partes as $valor) { $nuevo .= '&#'.ord($valor).';'; } return $nuevo; } function chrArray($email) { $partes = str_split(trim($email, ord(' '))); $nuevo = ''; var_dump($partes); foreach ($partes as $valor) { $nuevo .= chr(substr($valor, 2, strlen($valor) - 1)); } return $nuevo; } chrArray(ordArray('abc123 sasd ewrqewr werewr wererw'));
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(187) { [0]=> string(1) "&" [1]=> string(1) "#" [2]=> string(1) "9" [3]=> string(1) "7" [4]=> string(1) ";" [5]=> string(1) "&" [6]=> string(1) "#" [7]=> string(1) "9" [8]=> string(1) "8" [9]=> string(1) ";" [10]=> string(1) "&" [11]=> string(1) "#" [12]=> string(1) "9" [13]=> string(1) "9" [14]=> string(1) ";" [15]=> string(1) "&" [16]=> string(1) "#" [17]=> string(1) "4" [18]=> string(1) "9" [19]=> string(1) ";" [20]=> string(1) "&" [21]=> string(1) "#" [22]=> string(1) "5" [23]=> string(1) "0" [24]=> string(1) ";" [25]=> string(1) "&" [26]=> string(1) "#" [27]=> string(1) "5" [28]=> string(1) "1" [29]=> string(1) ";" [30]=> string(1) "&" [31]=> string(1) "#" [32]=> string(1) "3" [33]=> string(1) "2" [34]=> string(1) ";" [35]=> string(1) "&" [36]=> string(1) "#" [37]=> string(1) "1" [38]=> string(1) "1" [39]=> string(1) "5" [40]=> string(1) ";" [41]=> string(1) "&" [42]=> string(1) "#" [43]=> string(1) "9" [44]=> string(1) "7" [45]=> string(1) ";" [46]=> string(1) "&" [47]=> string(1) "#" [48]=> string(1) "1" [49]=> string(1) "1" [50]=> string(1) "5" [51]=> string(1) ";" [52]=> string(1) "&" [53]=> string(1) "#" [54]=> string(1) "1" [55]=> string(1) "0" [56]=> string(1) "0" [57]=> string(1) ";" [58]=> string(1) "&" [59]=> string(1) "#" [60]=> string(1) "3" [61]=> string(1) "2" [62]=> string(1) ";" [63]=> string(1) "&" [64]=> string(1) "#" [65]=> string(1) "1" [66]=> string(1) "0" [67]=> string(1) "1" [68]=> string(1) ";" [69]=> string(1) "&" [70]=> string(1) "#" [71]=> string(1) "1" [72]=> string(1) "1" [73]=> string(1) "9" [74]=> string(1) ";" [75]=> string(1) "&" [76]=> string(1) "#" [77]=> string(1) "1" [78]=> string(1) "1" [79]=> string(1) "4" [80]=> string(1) ";" [81]=> string(1) "&" [82]=> string(1) "#" [83]=> string(1) "1" [84]=> string(1) "1" [85]=> string(1) "3" [86]=> string(1) ";" [87]=> string(1) "&" [88]=> string(1) "#" [89]=> string(1) "1" [90]=> string(1) "0" [91]=> string(1) "1" [92]=> string(1) ";" [93]=> string(1) "&" [94]=> string(1) "#" [95]=> string(1) "1" [96]=> string(1) "1" [97]=> string(1) "9" [98]=> string(1) ";" [99]=> string(1) "&" [100]=> string(1) "#" [101]=> string(1) "1" [102]=> string(1) "1" [103]=> string(1) "4" [104]=> string(1) ";" [105]=> string(1) "&" [106]=> string(1) "#" [107]=> string(1) "3" [108]=> string(1) "2" [109]=> string(1) ";" [110]=> string(1) "&" [111]=> string(1) "#" [112]=> string(1) "1" [113]=> string(1) "1" [114]=> string(1) "9" [115]=> string(1) ";" [116]=> string(1) "&" [117]=> string(1) "#" [118]=> string(1) "1" [119]=> string(1) "0" [120]=> string(1) "1" [121]=> string(1) ";" [122]=> string(1) "&" [123]=> string(1) "#" [124]=> string(1) "1" [125]=> string(1) "1" [126]=> string(1) "4" [127]=> string(1) ";" [128]=> string(1) "&" [129]=> string(1) "#" [130]=> string(1) "1" [131]=> string(1) "0" [132]=> string(1) "1" [133]=> string(1) ";" [134]=> string(1) "&" [135]=> string(1) "#" [136]=> string(1) "1" [137]=> string(1) "1" [138]=> string(1) "9" [139]=> string(1) ";" [140]=> string(1) "&" [141]=> string(1) "#" [142]=> string(1) "1" [143]=> string(1) "1" [144]=> string(1) "4" [145]=> string(1) ";" [146]=> string(1) "&" [147]=> string(1) "#" [148]=> string(1) "3" [149]=> string(1) "2" [150]=> string(1) ";" [151]=> string(1) "&" [152]=> string(1) "#" [153]=> string(1) "1" [154]=> string(1) "1" [155]=> string(1) "9" [156]=> string(1) ";" [157]=> string(1) "&" [158]=> string(1) "#" [159]=> string(1) "1" [160]=> string(1) "0" [161]=> string(1) "1" [162]=> string(1) ";" [163]=> string(1) "&" [164]=> string(1) "#" [165]=> string(1) "1" [166]=> string(1) "1" [167]=> string(1) "4" [168]=> string(1) ";" [169]=> string(1) "&" [170]=> string(1) "#" [171]=> string(1) "1" [172]=> string(1) "0" [173]=> string(1) "1" [174]=> string(1) ";" [175]=> string(1) "&" [176]=> string(1) "#" [177]=> string(1) "1" [178]=> string(1) "1" [179]=> string(1) "4" [180]=> string(1) ";" [181]=> string(1) "&" [182]=> string(1) "#" [183]=> string(1) "1" [184]=> string(1) "1" [185]=> string(1) "9" [186]=> string(1) ";" }
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: str_split() in /in/P2nr5 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: str_split() in /in/P2nr5 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: str_split() in /in/P2nr5 on line 3