Announcement

Collapse
No announcement yet.

contents of a fragment outputs an html entitity instead of a character

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

    contents of a fragment outputs an html entitity instead of a character

    PHP specific question -
    i've got a fragment, and put a php block around so that I can use a bit of PHP within the fragment layout.

    within the fragment-text I put a simple phrase like add2cart.jpg
    When I pass the phrase through php and look at the physical output of the phrase add2cart.jpg the actual output code replaces the fullstop with the html entitity for the full stop ie .

    so I get something like add2cart.jpg
    does anyone know the php function that I have to use to replace the . with the actual character - in this case the fullstop,

    I've tried htmlentities($var) and html_entitity_decode($var) but no joy.

    possibly a Norman type question

    #2
    in the absence of Norman...does THIS help?
    Tracey

    Comment


      #3
      Tracey,

      Are you taking on PHP now

      Regards,
      Bruce King
      SellerDeck

      Comment


        #4
        LOL
        Actually, I've been looking at it this week and that site had seemed like one of the better ones so it was in my bookmarks.
        I thought there must be something useful in there!

        I want to know everything about everything
        Tracey

        Comment


          #5
          thanks for the suggestion Tracey, but thats where I started from

          this functions is only available in PHP5+ (actinic is only on php4 - been caught out before) and it seems to replace the html_entity_decode() functionality that I've tried.
          so thanks, but still puzzling

          ps. if you're playing with PHP, try visiting Tizag - they seem to offer some nice "get you started tutorials"
          They also do a nice simple set of CSS-style tutorials

          Comment


            #6
            sorry, Kevin..I noticed that was PHP5+ but I'm just a novice..didn't know Actinic wasn't, IYSWIM

            and thanks for those links! I've added them into my bookmarks.
            Tracey

            Comment


              #7
              Try
              Code:
              preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $string);
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                * hits his hand on his forehead *
                duhhh
                of course it is ! Why didn't I think of that !
                I'd have never got that solution, not in a million years

                Thanks Norman, your a star.

                Comment

                Working...
                X