SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2009
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    looking in 10 fields to output any stored text with one php formula

    I have 10 fields in a row that I want to search through to see if they contain text and then if they do I want to output that text for all of the non-empty fields (total fields per row is greater than 10). So I could do it all by hand but I'm trying instead to write one line in php which will sift through all 10 fields and output those that contain text. the naming for the fields follows the pattern top1, top2, top3, etc.

    I'm sure there is an easy way to do this and I just don't know how, any help is greatly appreciated.

  2. #2
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you provide more code? Sounds like you need to familiarize yourself with php's foreach, and use if/else logic inside.
    Cross browser css bugs

    Dan Schulz you will be missed


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •