#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Location
    Egypt
    Posts
    36
    Rep Power
    12

    I want to print </b>


    Hi there, how are you today

    my question is : how can i print the html or php code without execution like this

    PHP Code:
    echo '<b>Hello world</b>'
    i want when i call the page print

    echo '<b>Hello world</b>';

    not

    Hello world

    it that easy ?

    thanks for all,
  2. #2
  3. No Profile Picture
    I haz teh codez!
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2003
    Posts
    2,574
    Rep Power
    2343
    Is highlight_string what you're looking for?

    Comments on this post

    • ahmeds_link agrees : it's good
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Location
    Egypt
    Posts
    36
    Rep Power
    12
    Really thanks a lot Mr
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Location
    Egypt
    Posts
    36
    Rep Power
    12
    sorry i have another quistion

    i want to show 2 arrays

    An example :
    i have ...

    PHP Code:
    $ar1 = array('aa','bb','cc','dd'); 
    $ar2 = array('aaa','bbb','ccc','ddd'); 
    i want to show 2 arrays in only one foreach like

    PHP Code:
    foreach ( ......... ){ 
      echo 
    $ar1values."Knows".$ar2values
      } 
    thanks a lot,
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2008
    Location
    Whiteford, MD
    Posts
    535
    Rep Power
    161
    Also, for the print of </b>
    You can just do
    PHP Code:
    echo '& lt;b& gt;'
    Last edited by GameYin; May 11th, 2008 at 01:30 AM.
    Adwords Professional
    You can give me
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2005
    Posts
    228
    Rep Power
    0

    Here!


    Hi!
    You can try this, if the number of elements in both the arrays is the same:

    PHP Code:
    $ar1 = array('aa','bb','cc','dd');  
    $ar2 = array('aaa','bbb','ccc','ddd');

    for (
    $i=0$i<count($ar1); $i++)
    {
    echo 
    $ar1[$i] . " knows " $ar2[$i] . "<br />";

    Thanks!

    Comments on this post

    • ahmeds_link agrees : much thanks for you
    Last edited by speedbooster; May 11th, 2008 at 01:10 AM.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Location
    Egypt
    Posts
    36
    Rep Power
    12
    speedbooster
    it's a good idea thank you ...

    GameYin
    sorry mr but it can't be displayed
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2005
    Posts
    228
    Rep Power
    0
    Hi!

    No problem. You're welcome!

    Did you find solution to your first problem?

    Thanks!
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Location
    Egypt
    Posts
    36
    Rep Power
    12
    Did you find solution to your first problem?
    yes i found it in mr "ptr2void" reply by using highlight_string()
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2008
    Location
    Whiteford, MD
    Posts
    535
    Rep Power
    161
    Did you take away the spaces? Because I tried printing them without the spaces on here but it turned up like < and >
    Adwords Professional
    You can give me
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2008
    Location
    Egypt
    Posts
    36
    Rep Power
    12
    yes it's printed <b> also , thank you
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2008
    Location
    Whiteford, MD
    Posts
    535
    Rep Power
    161
    Ok, because I find my way easier. When I do tutorials on stuff, I just use my method. I find it is much easier coding and it just looks cooler
    Adwords Professional
    You can give me

IMN logo majestic logo threadwatch logo seochat tools logo