Announcement

Collapse
No announcement yet.

$variable =~ s/ /\_/g;

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Anscoop
    replied
    no, in PHP
    you don't have to differentiate an array with the @ sign

    it would be:
    $filedata = file("$filetorequire");

    See:
    http://www.php.net/manual/function.file.php





    [Edited by Anscoop on 10-01-2000 at 09:19 PM]

    Leave a comment:

  • Jalit
    New Member

  • Jalit
    replied
    So it would be this:
    -----
    @filedata = file("$filetorequire");
    -----
    Right?????

    Leave a comment:


  • Anscoop
    replied
    file("/path/to/file/file.txt");

    Leave a comment:

  • Jalit
    New Member

  • Jalit
    replied
    I need more help!!!
    is there something like this in php???
    -----
    @filedata = <FILE>;
    -----

    Leave a comment:

  • Freddie Bingham
    Former vBulletin Developer

  • Freddie Bingham
    replied
    Looks like sed to me.. (yoonix command)

    Leave a comment:

  • Dennis Wrenn
    Member

  • Dennis Wrenn
    replied
    There is a function in PHP called str_replace...

    Code:
    str_replace($what_to_find, $what_to_replace_it_with, $the_main_text);
    
    Ex:
    
    $mystr = "Hello Jalit This is from Bob";
    //my name isn't bob.. 
    $mystr = str_replace("Bob", "Dennis", $mystr);
    I think thats a little more coherint than that perl-like function....

    I was trying to learn Perl a while ago... I even have a few good books on it. but Since i heard of PHP, I stopped.. because compared to PHP, Perl sucks.......

    Leave a comment:

  • Jalit
    New Member

  • Jalit
    replied
    DW, that is a Perl code that searches threw the variable for an "_" in this case and changes it to a space I think.

    Leave a comment:

  • Jalit
    New Member

  • Jalit
    replied
    Dumb me, I forgot the quotes.
    I have another question tho.
    Is there an -e equivilent in PHP?

    Leave a comment:

  • Dennis Wrenn
    Member

  • Dennis Wrenn
    replied
    What is it supposed to do?
    maybe there is another way of doing it.

    Leave a comment:

  • Jalit
    New Member

  • Jalit
    started a topic $variable =~ s/ /\_/g;

    $variable =~ s/ /\_/g;

    Why doesn't this for in PHP???
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X