Annotation of embedaddon/php/ext/standard/tests/strings/substr_replace.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: substr_replace() function
3: --FILE--
4: <?php
5: $str = "try this";
6: $repl = "bala ";
7: $start = 2;
8: echo "\n";
9:
10:
11: echo "substr_replace('$str', '$repl', $start)\n";
12: var_dump(substr_replace($str, $repl, $start));
13: echo "\n";
14:
15: $len = 3;
16: echo "substr_replace('$str', '$repl', $start, $len)\n";
17: var_dump(substr_replace($str, $repl, $start, $len));
18: echo "\n";
19:
20: $len = 0;
21: echo "substr_replace('$str', '$repl', $start, $len)\n";
22: var_dump(substr_replace($str, $repl, $start, $len));
23: echo "\n";
24:
25: $len = -2;
26: echo "substr_replace('$str', '$repl', $start, $len)\n";
27: var_dump(substr_replace($str, $repl, $start, $len));
28: echo "\n";
29: echo "\n";
30: echo "\n";
31:
32:
33: $str = "try this";
34: $repl = array("bala ");
35: $start = 4;
36: $len = 3;
37: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).", ".var_export($start,1)."")."\n";
38: var_dump(substr_replace($str, $repl, $start))."\n";
39: echo "\n";
40: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).", ".var_export($start,1)."")."\n";
41: var_dump(substr_replace($str, $repl, $start, $len))."\n";
42: echo "\n";
43:
44: echo "\n";
45: echo "\n";
46: echo "\n";
47:
48:
49:
50: $str = array("ala portokala");
51: $repl = array("bala ");
52: $start = array(4);
53: $len = array(3);
54: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).", ".var_export($start,1)."")."\n";
55: var_dump(substr_replace($str, $repl, $start))."\n";
56: echo "\n";
57:
58: $len = array(3);
59: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).", ".var_export($start,1).", ".var_export($len,1).")")."\n";
60: var_dump(substr_replace($str, $repl, $start, $len))."\n";
61: echo "\n";
62:
63: $len = array(0);
64: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).", ".var_export($start,1).", ".var_export($len,1).")")."\n";
65: var_dump(substr_replace($str, $repl, $start, $len))."\n";
66: echo "\n";
67:
68: $len = array(-2);
69: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).", ".var_export($start,1).", ".var_export($len,1).")")."\n";
70: var_dump(substr_replace($str, $repl, $start, $len))."\n";
71: echo "\n";
72: echo "\n";
73: echo "\n";
74:
75:
76:
77:
78: $str = array("ala portokala");
79: $repl = "bala ";
80: $start = 4;
81: $len = 3;
82: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).")")."\n";
83: var_dump(substr_replace($str, $repl, $start))."\n";
84: echo "\n";
85: echo "\n";
86:
87:
88:
89: $str = array("ala portokala", "try this");
90: $repl = array("bala ");
91: $start = 4;
92: $len = 3;
93: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
94: var_dump(substr_replace($str, $repl, $start, $len))."\n";
95: echo "\n";
96: echo "\n";
97:
98:
99: $str = array("ala portokala", "try this");
100: $repl = "bala ";
101: $start = 4;
102: $len = 3;
103: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
104: var_dump(substr_replace($str, $repl, $start, $len))."\n";
105: echo "\n";
106:
107:
108: $str = array("ala portokala", "try this");
109: $repl = array("bala ");
110: $start = 4;
111: $len = 0;
112: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
113: var_dump(substr_replace($str, $repl, $start, $len))."\n";
114: echo "\n";
115: echo "\n";
116:
117:
118: $str = array("ala portokala", "try this");
119: $repl = "bala ";
120: $start = 4;
121: $len = 0;
122: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
123: var_dump(substr_replace($str, $repl, $start, $len))."\n";
124: echo "\n";
125:
126: $str = array("ala portokala", "try this");
127: $repl = array("bala ");
128: $start = 4;
129: $len = -2;
130: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
131: var_dump(substr_replace($str, $repl, $start, $len))."\n";
132: echo "\n";
133: echo "\n";
134:
135:
136: $str = array("ala portokala", "try this");
137: $repl = "bala ";
138: $start = 4;
139: $len = -2;
140: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
141: var_dump(substr_replace($str, $repl, $start, $len))."\n";
142: echo "\n";
143: echo "\n";
144: echo "\n";
145: echo "\n";
146: echo "\n";
147: echo "\n";
148:
149:
150:
151:
152: $str = array("ala portokala");
153: $repl = "bala ";
154: $start = array(4);
155: $len = 3;
156: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).")")."\n";
157: var_dump(substr_replace($str, $repl, $start))."\n";
158: echo "\n";
159: echo "\n";
160:
161:
162:
163: $str = array("ala portokala", "try this");
164: $repl = array("bala ");
165: $start = array(4);
166: $len = 3;
167: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
168: var_dump(substr_replace($str, $repl, $start, $len))."\n";
169: echo "\n";
170: echo "\n";
171:
172:
173: $str = array("ala portokala", "try this");
174: $repl = "bala ";
175: $start = array(4);
176: $len = 3;
177: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
178: var_dump(substr_replace($str, $repl, $start, $len))."\n";
179: echo "\n";
180:
181:
182: $str = array("ala portokala", "try this");
183: $repl = array("bala ");
184: $start = array(4);
185: $len = 0;
186: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
187: var_dump(substr_replace($str, $repl, $start, $len))."\n";
188: echo "\n";
189: echo "\n";
190:
191:
192: $str = array("ala portokala", "try this");
193: $repl = "bala ";
194: $start = array(4);
195: $len = 0;
196: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
197: var_dump(substr_replace($str, $repl, $start, $len))."\n";
198: echo "\n";
199:
200: $str = array("ala portokala", "try this");
201: $repl = array("bala ");
202: $start = array(4);
203: $len = -2;
204: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
205: var_dump(substr_replace($str, $repl, $start, $len))."\n";
206: echo "\n";
207: echo "\n";
208:
209:
210: $str = array("ala portokala", "try this");
211: $repl = "bala ";
212: $start = array(4);
213: $len = -2;
214: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
215: var_dump(substr_replace($str, $repl, $start, $len))."\n";
216: echo "\n";
217:
218:
219: echo "\n";
220: echo "\n";
221: echo "\n";
222: echo "\n";
223: echo "\n";
224: echo "\n";
225:
226:
227: $str = array("ala portokala");
228: $repl = "bala ";
229: $start = array(4,2);
230: $len = 3;
231: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).")")."\n";
232: var_dump(substr_replace($str, $repl, $start))."\n";
233: echo "\n";
234: echo "\n";
235:
236:
237:
238: $str = array("ala portokala", "try this");
239: $repl = array("bala ");
240: $start = array(4,2);
241: $len = 3;
242: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
243: var_dump(substr_replace($str, $repl, $start, $len))."\n";
244: echo "\n";
245: echo "\n";
246:
247:
248: $str = array("ala portokala", "try this");
249: $repl = "bala ";
250: $start = array(4,2);
251: $len = 3;
252: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
253: var_dump(substr_replace($str, $repl, $start, $len))."\n";
254: echo "\n";
255:
256:
257: $str = array("ala portokala", "try this");
258: $repl = array("bala ");
259: $start = array(4,2);
260: $len = 0;
261: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
262: var_dump(substr_replace($str, $repl, $start, $len))."\n";
263: echo "\n";
264: echo "\n";
265:
266:
267: $str = array("ala portokala", "try this");
268: $repl = "bala ";
269: $start = array(4,2);
270: $len = 0;
271: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
272: var_dump(substr_replace($str, $repl, $start, $len))."\n";
273: echo "\n";
274:
275: $str = array("ala portokala", "try this");
276: $repl = array("bala ");
277: $start = array(4,2);
278: $len = -2;
279: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
280: var_dump(substr_replace($str, $repl, $start, $len))."\n";
281: echo "\n";
282: echo "\n";
283:
284:
285: $str = array("ala portokala", "try this");
286: $repl = "bala ";
287: $start = array(4,2);
288: $len = -2;
289: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
290: var_dump(substr_replace($str, $repl, $start, $len))."\n";
291: echo "\n";
292:
293:
294:
295: echo "\n";
296: echo "\n";
297: echo "\n";
298: echo "\n";
299: echo "\n";
300: echo "\n";
301:
302:
303: $str = array("ala portokala");
304: $repl = "bala ";
305: $start = array(4,2);
306: $len = array(3);
307: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).")")."\n";
308: var_dump(substr_replace($str, $repl, $start))."\n";
309: echo "\n";
310: echo "\n";
311:
312:
313:
314: $str = array("ala portokala", "try this");
315: $repl = array("bala ");
316: $start = array(4,2);
317: $len = array(3);
318: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
319: var_dump(substr_replace($str, $repl, $start, $len))."\n";
320: echo "\n";
321: echo "\n";
322:
323:
324: $str = array("ala portokala", "try this");
325: $repl = "bala ";
326: $start = array(4,2);
327: $len = array(3);
328: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
329: var_dump(substr_replace($str, $repl, $start, $len))."\n";
330: echo "\n";
331:
332:
333: $str = array("ala portokala", "try this");
334: $repl = array("bala ");
335: $start = array(4,2);
336: $len = array(0);
337: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
338: var_dump(substr_replace($str, $repl, $start, $len))."\n";
339: echo "\n";
340: echo "\n";
341:
342:
343: $str = array("ala portokala", "try this");
344: $repl = "bala ";
345: $start = array(4,2);
346: $len = array(0);
347: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
348: var_dump(substr_replace($str, $repl, $start, $len))."\n";
349: echo "\n";
350:
351: $str = array("ala portokala", "try this");
352: $repl = array("bala ");
353: $start = array(4,2);
354: $len = array(-2);
355: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
356: var_dump(substr_replace($str, $repl, $start, $len))."\n";
357: echo "\n";
358: echo "\n";
359:
360:
361: $str = array("ala portokala", "try this");
362: $repl = "bala ";
363: $start = array(4,2);
364: $len = array(-2);
365: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
366: var_dump(substr_replace($str, $repl, $start, $len))."\n";
367: echo "\n";
368:
369:
370: echo "\n";
371: echo "\n";
372: echo "\n";
373: echo "\n";
374: echo "\n";
375: echo "\n";
376:
377:
378: $str = array("ala portokala");
379: $repl = "bala ";
380: $start = array(4,2);
381: $len = array(3,2);
382: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).")")."\n";
383: var_dump(substr_replace($str, $repl, $start))."\n";
384: echo "\n";
385: echo "\n";
386:
387:
388:
389: $str = array("ala portokala", "try this");
390: $repl = array("bala ");
391: $start = array(4,2);
392: $len = array(3,2);
393: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
394: var_dump(substr_replace($str, $repl, $start, $len))."\n";
395: echo "\n";
396: echo "\n";
397:
398:
399: $str = array("ala portokala", "try this");
400: $repl = "bala ";
401: $start = array(4,2);
402: $len = array(3,2);
403: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
404: var_dump(substr_replace($str, $repl, $start, $len))."\n";
405: echo "\n";
406:
407:
408: $str = array("ala portokala", "try this");
409: $repl = array("bala ");
410: $start = array(4,2);
411: $len = array(0,0);
412: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
413: var_dump(substr_replace($str, $repl, $start, $len))."\n";
414: echo "\n";
415: echo "\n";
416:
417:
418: $str = array("ala portokala", "try this");
419: $repl = "bala ";
420: $start = array(4,2);
421: $len = array(0,0);
422: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
423: var_dump(substr_replace($str, $repl, $start, $len))."\n";
424: echo "\n";
425:
426: $str = array("ala portokala", "try this");
427: $repl = array("bala ");
428: $start = array(4,2);
429: $len = array(-2,-3);
430: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
431: var_dump(substr_replace($str, $repl, $start, $len))."\n";
432: echo "\n";
433: echo "\n";
434:
435:
436: $str = array("ala portokala", "try this");
437: $repl = "bala ";
438: $start = array(4,2);
439: $len = array(-2,-3);
440: echo str_replace("\n","","substr_replace(".var_export($str,1).", ".var_export($repl,1).",".var_export($start,1).", ".var_export($len,1).")")."\n";
441: var_dump(substr_replace($str, $repl, $start, $len))."\n";
442: echo "\n";
443:
444:
445:
446:
447: ?>
448: --EXPECT--
449: substr_replace('try this', 'bala ', 2)
450: string(7) "trbala "
451:
452: substr_replace('try this', 'bala ', 2, 3)
453: string(10) "trbala his"
454:
455: substr_replace('try this', 'bala ', 2, 0)
456: string(13) "trbala y this"
457:
458: substr_replace('try this', 'bala ', 2, -2)
459: string(9) "trbala is"
460:
461:
462:
463: substr_replace('try this', array ( 0 => 'bala ',), 4
464: string(9) "try bala "
465:
466: substr_replace('try this', array ( 0 => 'bala ',), 4
467: string(10) "try bala s"
468:
469:
470:
471:
472: substr_replace(array ( 0 => 'ala portokala',), array ( 0 => 'bala ',), array ( 0 => 4,)
473: array(1) {
474: [0]=>
475: string(9) "ala bala "
476: }
477:
478: substr_replace(array ( 0 => 'ala portokala',), array ( 0 => 'bala ',), array ( 0 => 4,), array ( 0 => 3,))
479: array(1) {
480: [0]=>
481: string(15) "ala bala tokala"
482: }
483:
484: substr_replace(array ( 0 => 'ala portokala',), array ( 0 => 'bala ',), array ( 0 => 4,), array ( 0 => 0,))
485: array(1) {
486: [0]=>
487: string(18) "ala bala portokala"
488: }
489:
490: substr_replace(array ( 0 => 'ala portokala',), array ( 0 => 'bala ',), array ( 0 => 4,), array ( 0 => -2,))
491: array(1) {
492: [0]=>
493: string(11) "ala bala la"
494: }
495:
496:
497:
498: substr_replace(array ( 0 => 'ala portokala',), 'bala ',4)
499: array(1) {
500: [0]=>
501: string(9) "ala bala "
502: }
503:
504:
505: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),4, 3)
506: array(2) {
507: [0]=>
508: string(15) "ala bala tokala"
509: [1]=>
510: string(5) "try s"
511: }
512:
513:
514: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',4, 3)
515: array(2) {
516: [0]=>
517: string(15) "ala bala tokala"
518: [1]=>
519: string(10) "try bala s"
520: }
521:
522: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),4, 0)
523: array(2) {
524: [0]=>
525: string(18) "ala bala portokala"
526: [1]=>
527: string(8) "try this"
528: }
529:
530:
531: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',4, 0)
532: array(2) {
533: [0]=>
534: string(18) "ala bala portokala"
535: [1]=>
536: string(13) "try bala this"
537: }
538:
539: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),4, -2)
540: array(2) {
541: [0]=>
542: string(11) "ala bala la"
543: [1]=>
544: string(6) "try is"
545: }
546:
547:
548: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',4, -2)
549: array(2) {
550: [0]=>
551: string(11) "ala bala la"
552: [1]=>
553: string(11) "try bala is"
554: }
555:
556:
557:
558:
559:
560:
561: substr_replace(array ( 0 => 'ala portokala',), 'bala ',array ( 0 => 4,))
562: array(1) {
563: [0]=>
564: string(9) "ala bala "
565: }
566:
567:
568: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4,), 3)
569: array(2) {
570: [0]=>
571: string(15) "ala bala tokala"
572: [1]=>
573: string(5) " this"
574: }
575:
576:
577: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4,), 3)
578: array(2) {
579: [0]=>
580: string(15) "ala bala tokala"
581: [1]=>
582: string(10) "bala this"
583: }
584:
585: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4,), 0)
586: array(2) {
587: [0]=>
588: string(18) "ala bala portokala"
589: [1]=>
590: string(8) "try this"
591: }
592:
593:
594: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4,), 0)
595: array(2) {
596: [0]=>
597: string(18) "ala bala portokala"
598: [1]=>
599: string(13) "bala try this"
600: }
601:
602: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4,), -2)
603: array(2) {
604: [0]=>
605: string(11) "ala bala la"
606: [1]=>
607: string(2) "is"
608: }
609:
610:
611: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4,), -2)
612: array(2) {
613: [0]=>
614: string(11) "ala bala la"
615: [1]=>
616: string(7) "bala is"
617: }
618:
619:
620:
621:
622:
623:
624:
625: substr_replace(array ( 0 => 'ala portokala',), 'bala ',array ( 0 => 4, 1 => 2,))
626: array(1) {
627: [0]=>
628: string(9) "ala bala "
629: }
630:
631:
632: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), 3)
633: array(2) {
634: [0]=>
635: string(15) "ala bala tokala"
636: [1]=>
637: string(5) "trhis"
638: }
639:
640:
641: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), 3)
642: array(2) {
643: [0]=>
644: string(15) "ala bala tokala"
645: [1]=>
646: string(10) "trbala his"
647: }
648:
649: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), 0)
650: array(2) {
651: [0]=>
652: string(18) "ala bala portokala"
653: [1]=>
654: string(8) "try this"
655: }
656:
657:
658: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), 0)
659: array(2) {
660: [0]=>
661: string(18) "ala bala portokala"
662: [1]=>
663: string(13) "trbala y this"
664: }
665:
666: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), -2)
667: array(2) {
668: [0]=>
669: string(11) "ala bala la"
670: [1]=>
671: string(4) "tris"
672: }
673:
674:
675: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), -2)
676: array(2) {
677: [0]=>
678: string(11) "ala bala la"
679: [1]=>
680: string(9) "trbala is"
681: }
682:
683:
684:
685:
686:
687:
688:
689: substr_replace(array ( 0 => 'ala portokala',), 'bala ',array ( 0 => 4, 1 => 2,))
690: array(1) {
691: [0]=>
692: string(9) "ala bala "
693: }
694:
695:
696: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => 3,))
697: array(2) {
698: [0]=>
699: string(15) "ala bala tokala"
700: [1]=>
701: string(2) "tr"
702: }
703:
704:
705: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => 3,))
706: array(2) {
707: [0]=>
708: string(15) "ala bala tokala"
709: [1]=>
710: string(7) "trbala "
711: }
712:
713: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => 0,))
714: array(2) {
715: [0]=>
716: string(18) "ala bala portokala"
717: [1]=>
718: string(2) "tr"
719: }
720:
721:
722: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => 0,))
723: array(2) {
724: [0]=>
725: string(18) "ala bala portokala"
726: [1]=>
727: string(7) "trbala "
728: }
729:
730: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => -2,))
731: array(2) {
732: [0]=>
733: string(11) "ala bala la"
734: [1]=>
735: string(2) "tr"
736: }
737:
738:
739: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => -2,))
740: array(2) {
741: [0]=>
742: string(11) "ala bala la"
743: [1]=>
744: string(7) "trbala "
745: }
746:
747:
748:
749:
750:
751:
752:
753: substr_replace(array ( 0 => 'ala portokala',), 'bala ',array ( 0 => 4, 1 => 2,))
754: array(1) {
755: [0]=>
756: string(9) "ala bala "
757: }
758:
759:
760: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => 3, 1 => 2,))
761: array(2) {
762: [0]=>
763: string(15) "ala bala tokala"
764: [1]=>
765: string(6) "trthis"
766: }
767:
768:
769: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => 3, 1 => 2,))
770: array(2) {
771: [0]=>
772: string(15) "ala bala tokala"
773: [1]=>
774: string(11) "trbala this"
775: }
776:
777: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => 0, 1 => 0,))
778: array(2) {
779: [0]=>
780: string(18) "ala bala portokala"
781: [1]=>
782: string(8) "try this"
783: }
784:
785:
786: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => 0, 1 => 0,))
787: array(2) {
788: [0]=>
789: string(18) "ala bala portokala"
790: [1]=>
791: string(13) "trbala y this"
792: }
793:
794: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), array ( 0 => 'bala ',),array ( 0 => 4, 1 => 2,), array ( 0 => -2, 1 => -3,))
795: array(2) {
796: [0]=>
797: string(11) "ala bala la"
798: [1]=>
799: string(5) "trhis"
800: }
801:
802:
803: substr_replace(array ( 0 => 'ala portokala', 1 => 'try this',), 'bala ',array ( 0 => 4, 1 => 2,), array ( 0 => -2, 1 => -3,))
804: array(2) {
805: [0]=>
806: string(11) "ala bala la"
807: [1]=>
808: string(10) "trbala his"
809: }
810:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>