php code and foreign language

7 replies
Hi there, altering a php script to work in a foreign language and i need help!

eg i have this line
if(!checkLen('nom'))
$err[]='The name field is too short or empty!';

i want to put something like d'el in the $err[]='area' however of course when i put in the d'el it seems to the script that i am closing off the statement
eg
$err[]='es d'el';

any one help me

thanks again you guys you rock (as always)
#code #foreign #language #php
  • Profile picture of the author CarloD.
    Try
    $err[]='es d\'el';

    or

    $err[]="es d'el";
    Signature

    {{ DiscussionBoard.errors[1981463].message }}
  • Profile picture of the author thesuccesscoach
    ok tried the first one did not work will try the second one and see what happens
    Signature

    A life and business coach
    Ready to help you make it happen, just ask!

    {{ DiscussionBoard.errors[1981503].message }}
    • Profile picture of the author BenB969
      Banned
      [DELETED]
      {{ DiscussionBoard.errors[1982919].message }}
      • Profile picture of the author thesuccesscoach
        thanks guys it was late last night so i'll try it this afternoon when i am "fresher!"
        Signature

        A life and business coach
        Ready to help you make it happen, just ask!

        {{ DiscussionBoard.errors[1983222].message }}
        • Profile picture of the author CarloD.
          you could also try pasting the whole chunk of code.

          Whatever you have between <? and ?> .

          in case something else is wrong with the script.
          Signature

          {{ DiscussionBoard.errors[1983477].message }}
      • Profile picture of the author KirkMcD
        Originally Posted by BenB969 View Post

        It actually really should work... Maybe you've copied it wrong?

        The sign escapes the ' so it will be uesd as a letter in the text and not be used in the code.
        You can also do " to "escape" a quote sign.
        Escape sequences do not work when the string is enclosed by single quotes.
        {{ DiscussionBoard.errors[1983602].message }}
        • Profile picture of the author wayfarer
          Originally Posted by KirkMcD View Post

          Escape sequences do not work when the string is enclosed by single quotes.
          That's true, with one exception: escaping the single quote itself. You can't escape other things, like newlines, for example, without using double quotes.
          Signature
          I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
          {{ DiscussionBoard.errors[1984423].message }}
  • Profile picture of the author thesuccesscoach
    ok the \ worked a treat thanks guys
    Signature

    A life and business coach
    Ready to help you make it happen, just ask!

    {{ DiscussionBoard.errors[1985247].message }}

Trending Topics