Re: beginner question on multidimensional arrays



Here's an example using preg_replace

$pattern[0] = '/\/';
$pattern[1] = '/\}/';
$pattern[2] = '/\$/';
$pattern[3] = "/\%/";
$replacement[0] = '{';
$replacement[1] = '}';
$replacement[2] = '$';
$replacement[3] = '%';
$myvar = preg_replace($pattern, $replacement, $myvar);

$pattern is the array of text or characters to search for.
$replacement is what to replace with
In this example, some characters are replaced with their html escape
codes

.



Relevant Pages

  • Re: PIC P put to real use
    ... PICTURE and the INSPECT in such a case, because it's clearer in both ... characters being replaced as well as the replacement text! ... about the replacement of characters in a numeric-edited data item once its ... I actually like that better than the reference modification. ...
    (comp.lang.cobol)
  • Re: PIC P put to real use
    ... PICTURE and the INSPECT in such a case, because it's clearer in both ... characters being replaced as well as the replacement text! ... about the replacement of characters in a numeric-edited data item once its ... I actually like that better than the reference modification. ...
    (comp.lang.cobol)
  • Re: Need Cyrillic Font with Accents
    ... I found a replacement solution that is not too bad. ... I guess you mean "Combining Diacritical Marks". ... The idea of using such characters is in full conformance to the Unicode ... that reflects the Unicode idea of implementing combining diacritics). ...
    (comp.fonts)
  • Re: use value of variable in a statement
    ... Isn't there a pair of characters or something that will allow a replacement ... Dim strsql, rtxx As String ... If screenName = "ynot" then...... ...
    (microsoft.public.access.formscoding)
  • Re: replace characters by numbers
    ... Tom Ogilvy ... "Michael E." ... sometimes the replacement logic is ... characters by numbers is mainly for statistic reasons. ...
    (microsoft.public.excel.programming)